diff --git a/parachain/runtime/src/lib.rs b/parachain/runtime/src/lib.rs index a00c7319e7..81ae99b464 100644 --- a/parachain/runtime/src/lib.rs +++ b/parachain/runtime/src/lib.rs @@ -46,7 +46,7 @@ pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; // PolkaBTC exports -pub use btc_relay::{bitcoin, Call as RelayCall}; +pub use btc_relay::{bitcoin, Call as RelayCall, TARGET_SPACING}; pub use module_exchange_rate_oracle_rpc_runtime_api::BalanceWrapper; // XCM imports diff --git a/parachain/src/chain_spec.rs b/parachain/src/chain_spec.rs index 6397a10812..fa55745323 100644 --- a/parachain/src/chain_spec.rs +++ b/parachain/src/chain_spec.rs @@ -1,9 +1,12 @@ use btc_parachain_runtime::{ - AccountId, BTCRelayConfig, DOTConfig, ExchangeRateOracleConfig, FeeConfig, GenesisConfig, IssueConfig, + AccountId, BTCRelayConfig, BlockNumber, DOTConfig, ExchangeRateOracleConfig, FeeConfig, GenesisConfig, IssueConfig, PolkaBTCConfig, RedeemConfig, RefundConfig, ReplaceConfig, Signature, SlaConfig, StakedRelayersConfig, SudoConfig, - SystemConfig, VaultRegistryConfig, DAYS, MINUTES, WASM_BINARY, + SystemConfig, VaultRegistryConfig, DAYS, MILLISECS_PER_BLOCK, MINUTES, TARGET_SPACING, WASM_BINARY, }; +const BITCOIN_SPACING_MS: u32 = TARGET_SPACING * 1000; +const BLOCK_SPACING: BlockNumber = BITCOIN_SPACING_MS / MILLISECS_PER_BLOCK as BlockNumber; + #[cfg(feature = "aura-grandpa")] use { btc_parachain_runtime::{AuraConfig, GrandpaConfig}, @@ -300,13 +303,23 @@ pub fn development_config(#[cfg(feature = "cumulus-polkadot")] id: ParaId) -> Ch #[cfg(feature = "runtime-benchmarks")] account("Vault", 0, 0), ], - vec![( - get_account_id_from_seed::("Bob"), - "Bob".as_bytes().to_vec(), - )], + vec![ + ( + get_account_id_from_seed::("Alice"), + "Alice".as_bytes().to_vec(), + ), + ( + get_account_id_from_seed::("Bob"), + "Bob".as_bytes().to_vec(), + ), + ( + get_account_id_from_seed::("Charlie"), + "Charlie".as_bytes().to_vec(), + ), + ], #[cfg(feature = "cumulus-polkadot")] id, - 0, + 1, ) }, Vec::new(), @@ -379,8 +392,7 @@ fn testnet_genesis( }, btc_relay: BTCRelayConfig { bitcoin_confirmations, - // TODO: `parachain_confirmations: bitcoin_confirmations.saturating_mul(SECS_PER_BLOCK)` - parachain_confirmations: 0, + parachain_confirmations: bitcoin_confirmations.saturating_mul(BLOCK_SPACING), disable_difficulty_check: true, disable_inclusion_check: false, disable_op_return_check: false,