Skip to content

Commit

Permalink
Merge pull request #55 from gregdhill/chore/chain-spec
Browse files Browse the repository at this point in the history
chore: more authorized oracles on dev, parameterise parachain confirm…
  • Loading branch information
gregdhill authored Mar 26, 2021
2 parents 80e33ac + 1999692 commit d69fe77
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion parachain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 21 additions & 9 deletions parachain/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down Expand Up @@ -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::<sr25519::Public>("Bob"),
"Bob".as_bytes().to_vec(),
)],
vec![
(
get_account_id_from_seed::<sr25519::Public>("Alice"),
"Alice".as_bytes().to_vec(),
),
(
get_account_id_from_seed::<sr25519::Public>("Bob"),
"Bob".as_bytes().to_vec(),
),
(
get_account_id_from_seed::<sr25519::Public>("Charlie"),
"Charlie".as_bytes().to_vec(),
),
],
#[cfg(feature = "cumulus-polkadot")]
id,
0,
1,
)
},
Vec::new(),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d69fe77

Please sign in to comment.