Companion for #8990 (#3194)

* Use new naming scheme for all Event enums generated by construct_runtime

* Use new naming scheme for all GenesisConfig fields generated by construct_runtime

* Fix overlooked GenesisConfig field renaming

* update Substrate

Co-authored-by: parity-processbot <>
This commit is contained in:
Keith Yeung
2021-06-09 03:07:04 -07:00
committed by GitHub
parent f6cbe8e8d8
commit 99d49ad7c9
14 changed files with 338 additions and 340 deletions
+159 -161
View File
File diff suppressed because it is too large Load Diff
@@ -175,27 +175,27 @@ fn testnet_genesis(
_enable_println: bool, _enable_println: bool,
) -> GenesisConfig { ) -> GenesisConfig {
GenesisConfig { GenesisConfig {
frame_system: SystemConfig { system: SystemConfig {
code: WASM_BINARY.expect("Millau development WASM not available").to_vec(), code: WASM_BINARY.expect("Millau development WASM not available").to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_balances: BalancesConfig { balances: BalancesConfig {
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 40)).collect(), balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 40)).collect(),
}, },
pallet_aura: AuraConfig { aura: AuraConfig {
authorities: Vec::new(), authorities: Vec::new(),
}, },
pallet_grandpa: GrandpaConfig { grandpa: GrandpaConfig {
authorities: Vec::new(), authorities: Vec::new(),
}, },
pallet_sudo: SudoConfig { key: root_key }, sudo: SudoConfig { key: root_key },
pallet_session: SessionConfig { session: SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| (x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone()))) .map(|x| (x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone())))
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_bridge_grandpa_Instance1: BridgeWestendGrandpaConfig { bridge_westend_grandpa: BridgeWestendGrandpaConfig {
// for our deployments to avoid multiple same-nonces transactions: // for our deployments to avoid multiple same-nonces transactions:
// //Alice is already used to initialize Rialto<->Millau bridge // //Alice is already used to initialize Rialto<->Millau bridge
// => let's use //George to initialize Westend->Millau bridge // => let's use //George to initialize Westend->Millau bridge
@@ -16,7 +16,7 @@
use bp_rialto::derive_account_from_millau_id; use bp_rialto::derive_account_from_millau_id;
use rialto_runtime::{ use rialto_runtime::{
AccountId, AuraConfig, BalancesConfig, BridgeKovanConfig, BridgeRialtoPoAConfig, GenesisConfig, GrandpaConfig, AccountId, AuraConfig, BalancesConfig, BridgeKovanConfig, BridgeRialtoPoaConfig, GenesisConfig, GrandpaConfig,
SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, WASM_BINARY, SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, WASM_BINARY,
}; };
use serde_json::json; use serde_json::json;
@@ -176,23 +176,23 @@ fn testnet_genesis(
_enable_println: bool, _enable_println: bool,
) -> GenesisConfig { ) -> GenesisConfig {
GenesisConfig { GenesisConfig {
frame_system: SystemConfig { system: SystemConfig {
code: WASM_BINARY.expect("Rialto development WASM not available").to_vec(), code: WASM_BINARY.expect("Rialto development WASM not available").to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_balances: BalancesConfig { balances: BalancesConfig {
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 40)).collect(), balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 40)).collect(),
}, },
pallet_aura: AuraConfig { aura: AuraConfig {
authorities: Vec::new(), authorities: Vec::new(),
}, },
pallet_bridge_eth_poa_Instance1: load_rialto_poa_bridge_config(), bridge_rialto_poa: load_rialto_poa_bridge_config(),
pallet_bridge_eth_poa_Instance2: load_kovan_bridge_config(), bridge_kovan: load_kovan_bridge_config(),
pallet_grandpa: GrandpaConfig { grandpa: GrandpaConfig {
authorities: Vec::new(), authorities: Vec::new(),
}, },
pallet_sudo: SudoConfig { key: root_key }, sudo: SudoConfig { key: root_key },
pallet_session: SessionConfig { session: SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| (x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone()))) .map(|x| (x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone())))
@@ -201,8 +201,8 @@ fn testnet_genesis(
} }
} }
fn load_rialto_poa_bridge_config() -> BridgeRialtoPoAConfig { fn load_rialto_poa_bridge_config() -> BridgeRialtoPoaConfig {
BridgeRialtoPoAConfig { BridgeRialtoPoaConfig {
initial_header: rialto_runtime::rialto_poa::genesis_header(), initial_header: rialto_runtime::rialto_poa::genesis_header(),
initial_difficulty: 0.into(), initial_difficulty: 0.into(),
initial_validators: rialto_runtime::rialto_poa::genesis_validators(), initial_validators: rialto_runtime::rialto_poa::genesis_validators(),
@@ -497,7 +497,7 @@ construct_runtime!(
NodeBlock = opaque::Block, NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic UncheckedExtrinsic = UncheckedExtrinsic
{ {
BridgeRialtoPoA: pallet_bridge_eth_poa::<Instance1>::{Pallet, Call, Config, Storage, ValidateUnsigned}, BridgeRialtoPoa: pallet_bridge_eth_poa::<Instance1>::{Pallet, Call, Config, Storage, ValidateUnsigned},
BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Pallet, Call, Config, Storage, ValidateUnsigned}, BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Pallet, Call, Config, Storage, ValidateUnsigned},
BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Pallet, Call}, BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Pallet, Call},
BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Pallet, Call}, BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Pallet, Call},
@@ -597,21 +597,21 @@ impl_runtime_apis! {
impl bp_eth_poa::RialtoPoAHeaderApi<Block> for Runtime { impl bp_eth_poa::RialtoPoAHeaderApi<Block> for Runtime {
fn best_block() -> (u64, bp_eth_poa::H256) { fn best_block() -> (u64, bp_eth_poa::H256) {
let best_block = BridgeRialtoPoA::best_block(); let best_block = BridgeRialtoPoa::best_block();
(best_block.number, best_block.hash) (best_block.number, best_block.hash)
} }
fn finalized_block() -> (u64, bp_eth_poa::H256) { fn finalized_block() -> (u64, bp_eth_poa::H256) {
let finalized_block = BridgeRialtoPoA::finalized_block(); let finalized_block = BridgeRialtoPoa::finalized_block();
(finalized_block.number, finalized_block.hash) (finalized_block.number, finalized_block.hash)
} }
fn is_import_requires_receipts(header: bp_eth_poa::AuraHeader) -> bool { fn is_import_requires_receipts(header: bp_eth_poa::AuraHeader) -> bool {
BridgeRialtoPoA::is_import_requires_receipts(header) BridgeRialtoPoa::is_import_requires_receipts(header)
} }
fn is_known_block(hash: bp_eth_poa::H256) -> bool { fn is_known_block(hash: bp_eth_poa::H256) -> bool {
BridgeRialtoPoA::is_known_block(hash) BridgeRialtoPoa::is_known_block(hash)
} }
} }
@@ -130,7 +130,7 @@ impl InclusionProofVerifier for RialtoBlockchain {
fn verify_transaction_inclusion_proof(proof: &Self::TransactionInclusionProof) -> Option<Self::Transaction> { fn verify_transaction_inclusion_proof(proof: &Self::TransactionInclusionProof) -> Option<Self::Transaction> {
let is_transaction_finalized = let is_transaction_finalized =
crate::BridgeRialtoPoA::verify_transaction_finalized(proof.block, proof.index, &proof.proof); crate::BridgeRialtoPoa::verify_transaction_finalized(proof.block, proof.index, &proof.proof);
if !is_transaction_finalized { if !is_transaction_finalized {
return None; return None;
+9 -9
View File
@@ -510,7 +510,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageVersionSpecMismatch( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageVersionSpecMismatch(
bridge, bridge,
id, id,
TEST_SPEC_VERSION, TEST_SPEC_VERSION,
@@ -538,7 +538,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageWeightMismatch( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageWeightMismatch(
bridge, id, 1345000, 0, bridge, id, 1345000, 0,
)), )),
topics: vec![], topics: vec![],
@@ -566,7 +566,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageSignatureMismatch( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageSignatureMismatch(
bridge, id bridge, id
)), )),
topics: vec![], topics: vec![],
@@ -588,7 +588,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageRejected(bridge, id)), event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageRejected(bridge, id)),
topics: vec![], topics: vec![],
}], }],
); );
@@ -612,7 +612,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageCallDecodeFailed( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageCallDecodeFailed(
bridge, id bridge, id
)), )),
topics: vec![], topics: vec![],
@@ -639,7 +639,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageCallRejected(bridge, id)), event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageCallRejected(bridge, id)),
topics: vec![], topics: vec![],
}], }],
); );
@@ -660,7 +660,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched(
bridge, bridge,
id, id,
Ok(()) Ok(())
@@ -687,7 +687,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched(
bridge, bridge,
id, id,
Ok(()) Ok(())
@@ -714,7 +714,7 @@ mod tests {
System::events(), System::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched( event: Event::Dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched(
bridge, bridge,
id, id,
Ok(()) Ok(())
+4 -4
View File
@@ -878,7 +878,7 @@ mod tests {
System::<TestRuntime>::events(), System::<TestRuntime>::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: TestEvent::pallet_bridge_messages(RawEvent::MessageAccepted(TEST_LANE_ID, 1)), event: TestEvent::Messages(RawEvent::MessageAccepted(TEST_LANE_ID, 1)),
topics: vec![], topics: vec![],
}], }],
); );
@@ -907,7 +907,7 @@ mod tests {
System::<TestRuntime>::events(), System::<TestRuntime>::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: TestEvent::pallet_bridge_messages(RawEvent::MessagesDelivered(TEST_LANE_ID, 1, 1)), event: TestEvent::Messages(RawEvent::MessagesDelivered(TEST_LANE_ID, 1, 1)),
topics: vec![], topics: vec![],
}], }],
); );
@@ -987,7 +987,7 @@ mod tests {
System::<TestRuntime>::events(), System::<TestRuntime>::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: TestEvent::pallet_bridge_messages(RawEvent::ParameterUpdated(parameter)), event: TestEvent::Messages(RawEvent::ParameterUpdated(parameter)),
topics: vec![], topics: vec![],
}], }],
); );
@@ -1011,7 +1011,7 @@ mod tests {
System::<TestRuntime>::events(), System::<TestRuntime>::events(),
vec![EventRecord { vec![EventRecord {
phase: Phase::Initialization, phase: Phase::Initialization,
event: TestEvent::pallet_bridge_messages(RawEvent::ParameterUpdated(parameter)), event: TestEvent::Messages(RawEvent::ParameterUpdated(parameter)),
topics: vec![], topics: vec![],
}], }],
); );
@@ -60,7 +60,7 @@ impl BridgeInstance for RialtoPoA {
.collect(), .collect(),
); );
rialto_runtime::Call::BridgeRialtoPoA(pallet_call) rialto_runtime::Call::BridgeRialtoPoa(pallet_call)
} }
fn build_unsigned_header_call(&self, header: QueuedEthereumHeader) -> Call { fn build_unsigned_header_call(&self, header: QueuedEthereumHeader) -> Call {
@@ -69,7 +69,7 @@ impl BridgeInstance for RialtoPoA {
into_substrate_ethereum_receipts(header.extra()), into_substrate_ethereum_receipts(header.extra()),
); );
rialto_runtime::Call::BridgeRialtoPoA(pallet_call) rialto_runtime::Call::BridgeRialtoPoa(pallet_call)
} }
fn build_currency_exchange_call(&self, proof: Proof) -> Call { fn build_currency_exchange_call(&self, proof: Proof) -> Call {
+124 -124
View File
@@ -290,19 +290,19 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
const STASH: u128 = 100 * DOT; const STASH: u128 = 100 * DOT;
polkadot::GenesisConfig { polkadot::GenesisConfig {
frame_system: polkadot::SystemConfig { system: polkadot::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_balances: polkadot::BalancesConfig { balances: polkadot::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT)) .map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect(), .collect(),
}, },
pallet_indices: polkadot::IndicesConfig { indices: vec![] }, indices: polkadot::IndicesConfig { indices: vec![] },
pallet_session: polkadot::SessionConfig { session: polkadot::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -321,7 +321,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: polkadot::StakingConfig { staking: polkadot::StakingConfig {
validator_count: 50, validator_count: 50,
minimum_validator_count: 4, minimum_validator_count: 4,
stakers: initial_authorities stakers: initial_authorities
@@ -340,30 +340,30 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_elections_phragmen: Default::default(), phragmen_election: Default::default(),
pallet_democracy: Default::default(), democracy: Default::default(),
pallet_collective_Instance1: polkadot::CouncilConfig { council: polkadot::CouncilConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_collective_Instance2: polkadot::TechnicalCommitteeConfig { technical_committee: polkadot::TechnicalCommitteeConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_membership_Instance1: Default::default(), technical_membership: Default::default(),
pallet_babe: polkadot::BabeConfig { babe: polkadot::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(polkadot::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(polkadot::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_authority_discovery: polkadot::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: polkadot::AuthorityDiscoveryConfig { keys: vec![] },
claims: polkadot::ClaimsConfig { claims: polkadot::ClaimsConfig {
claims: vec![], claims: vec![],
vesting: vec![], vesting: vec![],
}, },
pallet_vesting: polkadot::VestingConfig { vesting: vec![] }, vesting: polkadot::VestingConfig { vesting: vec![] },
pallet_treasury: Default::default(), treasury: Default::default(),
} }
} }
@@ -464,19 +464,19 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi
const STASH: u128 = 100 * WND; const STASH: u128 = 100 * WND;
westend::GenesisConfig { westend::GenesisConfig {
frame_system: westend::SystemConfig { system: westend::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_balances: westend::BalancesConfig { balances: westend::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT)) .map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect(), .collect(),
}, },
pallet_indices: westend::IndicesConfig { indices: vec![] }, indices: westend::IndicesConfig { indices: vec![] },
pallet_session: westend::SessionConfig { session: westend::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -495,7 +495,7 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: westend::StakingConfig { staking: westend::StakingConfig {
validator_count: 50, validator_count: 50,
minimum_validator_count: 4, minimum_validator_count: 4,
stakers: initial_authorities stakers: initial_authorities
@@ -514,21 +514,21 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_babe: westend::BabeConfig { babe: westend::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(westend::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(westend::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_authority_discovery: westend::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: westend::AuthorityDiscoveryConfig { keys: vec![] },
pallet_vesting: westend::VestingConfig { vesting: vec![] }, vesting: westend::VestingConfig { vesting: vec![] },
pallet_sudo: westend::SudoConfig { sudo: westend::SudoConfig {
key: endowed_accounts[0].clone(), key: endowed_accounts[0].clone(),
}, },
parachains_configuration: westend::ParachainsConfigurationConfig { parachains_configuration: westend::ParachainsConfigurationConfig {
config: default_parachains_host_configuration(), config: default_parachains_host_configuration(),
}, },
parachains_paras: Default::default(), paras: Default::default(),
} }
} }
@@ -660,19 +660,19 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC
const STASH: u128 = 100 * KSM; const STASH: u128 = 100 * KSM;
kusama::GenesisConfig { kusama::GenesisConfig {
frame_system: kusama::SystemConfig { system: kusama::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_balances: kusama::BalancesConfig { balances: kusama::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT)) .map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect(), .collect(),
}, },
pallet_indices: kusama::IndicesConfig { indices: vec![] }, indices: kusama::IndicesConfig { indices: vec![] },
pallet_session: kusama::SessionConfig { session: kusama::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -691,7 +691,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: kusama::StakingConfig { staking: kusama::StakingConfig {
validator_count: 50, validator_count: 50,
minimum_validator_count: 4, minimum_validator_count: 4,
stakers: initial_authorities stakers: initial_authorities
@@ -710,35 +710,35 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_elections_phragmen: Default::default(), phragmen_election: Default::default(),
pallet_democracy: Default::default(), democracy: Default::default(),
pallet_collective_Instance1: kusama::CouncilConfig { council: kusama::CouncilConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_collective_Instance2: kusama::TechnicalCommitteeConfig { technical_committee: kusama::TechnicalCommitteeConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_membership_Instance1: Default::default(), technical_membership: Default::default(),
pallet_babe: kusama::BabeConfig { babe: kusama::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(kusama::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(kusama::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_authority_discovery: kusama::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: kusama::AuthorityDiscoveryConfig { keys: vec![] },
claims: kusama::ClaimsConfig { claims: kusama::ClaimsConfig {
claims: vec![], claims: vec![],
vesting: vec![], vesting: vec![],
}, },
pallet_vesting: kusama::VestingConfig { vesting: vec![] }, vesting: kusama::VestingConfig { vesting: vec![] },
pallet_treasury: Default::default(), treasury: Default::default(),
parachains_configuration: kusama::ParachainsConfigurationConfig { parachains_configuration: kusama::ParachainsConfigurationConfig {
config: default_parachains_host_configuration(), config: default_parachains_host_configuration(),
}, },
pallet_gilt: Default::default(), gilt: Default::default(),
parachains_paras: Default::default(), paras: Default::default(),
} }
} }
@@ -931,21 +931,21 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
const STASH: u128 = 100 * ROC; const STASH: u128 = 100 * ROC;
rococo_runtime::GenesisConfig { rococo_runtime::GenesisConfig {
frame_system: rococo_runtime::SystemConfig { system: rococo_runtime::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_balances: rococo_runtime::BalancesConfig { balances: rococo_runtime::BalancesConfig {
balances: endowed_accounts.iter() balances: endowed_accounts.iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT)) .map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect(), .collect(),
}, },
pallet_beefy: Default::default(), beefy: Default::default(),
pallet_indices: rococo_runtime::IndicesConfig { indices: rococo_runtime::IndicesConfig {
indices: vec![], indices: vec![],
}, },
pallet_session: rococo_runtime::SessionConfig { session: rococo_runtime::SessionConfig {
keys: initial_authorities.iter().map(|x| ( keys: initial_authorities.iter().map(|x| (
x.0.clone(), x.0.clone(),
x.0.clone(), x.0.clone(),
@@ -960,33 +960,33 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
), ),
)).collect::<Vec<_>>(), )).collect::<Vec<_>>(),
}, },
pallet_babe: rococo_runtime::BabeConfig { babe: rococo_runtime::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_collective: Default::default(), collective: Default::default(),
pallet_membership: Default::default(), membership: Default::default(),
pallet_authority_discovery: rococo_runtime::AuthorityDiscoveryConfig { authority_discovery: rococo_runtime::AuthorityDiscoveryConfig {
keys: vec![], keys: vec![],
}, },
pallet_sudo: rococo_runtime::SudoConfig { sudo: rococo_runtime::SudoConfig {
key: endowed_accounts[0].clone(), key: endowed_accounts[0].clone(),
}, },
parachains_paras: rococo_runtime::ParasConfig { paras: rococo_runtime::ParasConfig {
paras: vec![], paras: vec![],
_phdata: Default::default(), _phdata: Default::default(),
}, },
parachains_hrmp: Default::default(), hrmp: Default::default(),
parachains_configuration: rococo_runtime::ParachainsConfigurationConfig { parachains_configuration: rococo_runtime::ParachainsConfigurationConfig {
config: default_parachains_host_configuration(), config: default_parachains_host_configuration(),
}, },
pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
owner: Some(endowed_accounts[0].clone()), owner: Some(endowed_accounts[0].clone()),
..Default::default() ..Default::default()
}, },
pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { bridge_wococo_grandpa: rococo_runtime::BridgeWococoGrandpaConfig {
owner: Some(endowed_accounts[0].clone()), owner: Some(endowed_accounts[0].clone()),
..Default::default() ..Default::default()
}, },
@@ -1182,18 +1182,18 @@ pub fn polkadot_testnet_genesis(
const STASH: u128 = 100 * DOT; const STASH: u128 = 100 * DOT;
polkadot::GenesisConfig { polkadot::GenesisConfig {
frame_system: polkadot::SystemConfig { system: polkadot::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_indices: polkadot::IndicesConfig { indices: vec![] }, indices: polkadot::IndicesConfig { indices: vec![] },
pallet_balances: polkadot::BalancesConfig { balances: polkadot::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k| (k.clone(), ENDOWMENT)) .map(|k| (k.clone(), ENDOWMENT))
.collect(), .collect(),
}, },
pallet_session: polkadot::SessionConfig { session: polkadot::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -1212,7 +1212,7 @@ pub fn polkadot_testnet_genesis(
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: polkadot::StakingConfig { staking: polkadot::StakingConfig {
minimum_validator_count: 1, minimum_validator_count: 1,
validator_count: 2, validator_count: 2,
stakers: initial_authorities stakers: initial_authorities
@@ -1231,30 +1231,30 @@ pub fn polkadot_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_elections_phragmen: Default::default(), phragmen_election: Default::default(),
pallet_democracy: polkadot::DemocracyConfig::default(), democracy: polkadot::DemocracyConfig::default(),
pallet_collective_Instance1: polkadot::CouncilConfig { council: polkadot::CouncilConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_collective_Instance2: polkadot::TechnicalCommitteeConfig { technical_committee: polkadot::TechnicalCommitteeConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_membership_Instance1: Default::default(), technical_membership: Default::default(),
pallet_babe: polkadot::BabeConfig { babe: polkadot::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(polkadot::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(polkadot::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_authority_discovery: polkadot::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: polkadot::AuthorityDiscoveryConfig { keys: vec![] },
claims: polkadot::ClaimsConfig { claims: polkadot::ClaimsConfig {
claims: vec![], claims: vec![],
vesting: vec![], vesting: vec![],
}, },
pallet_vesting: polkadot::VestingConfig { vesting: vec![] }, vesting: polkadot::VestingConfig { vesting: vec![] },
pallet_treasury: Default::default(), treasury: Default::default(),
} }
} }
@@ -1281,18 +1281,18 @@ pub fn kusama_testnet_genesis(
const STASH: u128 = 100 * KSM; const STASH: u128 = 100 * KSM;
kusama::GenesisConfig { kusama::GenesisConfig {
frame_system: kusama::SystemConfig { system: kusama::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_indices: kusama::IndicesConfig { indices: vec![] }, indices: kusama::IndicesConfig { indices: vec![] },
pallet_balances: kusama::BalancesConfig { balances: kusama::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k| (k.clone(), ENDOWMENT)) .map(|k| (k.clone(), ENDOWMENT))
.collect(), .collect(),
}, },
pallet_session: kusama::SessionConfig { session: kusama::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -1311,7 +1311,7 @@ pub fn kusama_testnet_genesis(
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: kusama::StakingConfig { staking: kusama::StakingConfig {
minimum_validator_count: 1, minimum_validator_count: 1,
validator_count: 2, validator_count: 2,
stakers: initial_authorities stakers: initial_authorities
@@ -1330,35 +1330,35 @@ pub fn kusama_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_elections_phragmen: Default::default(), phragmen_election: Default::default(),
pallet_democracy: kusama::DemocracyConfig::default(), democracy: kusama::DemocracyConfig::default(),
pallet_collective_Instance1: kusama::CouncilConfig { council: kusama::CouncilConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_collective_Instance2: kusama::TechnicalCommitteeConfig { technical_committee: kusama::TechnicalCommitteeConfig {
members: vec![], members: vec![],
phantom: Default::default(), phantom: Default::default(),
}, },
pallet_membership_Instance1: Default::default(), technical_membership: Default::default(),
pallet_babe: kusama::BabeConfig { babe: kusama::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(kusama::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(kusama::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_authority_discovery: kusama::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: kusama::AuthorityDiscoveryConfig { keys: vec![] },
claims: kusama::ClaimsConfig { claims: kusama::ClaimsConfig {
claims: vec![], claims: vec![],
vesting: vec![], vesting: vec![],
}, },
pallet_vesting: kusama::VestingConfig { vesting: vec![] }, vesting: kusama::VestingConfig { vesting: vec![] },
pallet_treasury: Default::default(), treasury: Default::default(),
parachains_configuration: kusama::ParachainsConfigurationConfig { parachains_configuration: kusama::ParachainsConfigurationConfig {
config: default_parachains_host_configuration(), config: default_parachains_host_configuration(),
}, },
pallet_gilt: Default::default(), gilt: Default::default(),
parachains_paras: Default::default(), paras: Default::default(),
} }
} }
@@ -1385,18 +1385,18 @@ pub fn westend_testnet_genesis(
const STASH: u128 = 100 * DOT; const STASH: u128 = 100 * DOT;
westend::GenesisConfig { westend::GenesisConfig {
frame_system: westend::SystemConfig { system: westend::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_indices: westend::IndicesConfig { indices: vec![] }, indices: westend::IndicesConfig { indices: vec![] },
pallet_balances: westend::BalancesConfig { balances: westend::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k| (k.clone(), ENDOWMENT)) .map(|k| (k.clone(), ENDOWMENT))
.collect(), .collect(),
}, },
pallet_session: westend::SessionConfig { session: westend::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -1415,7 +1415,7 @@ pub fn westend_testnet_genesis(
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: westend::StakingConfig { staking: westend::StakingConfig {
minimum_validator_count: 1, minimum_validator_count: 1,
validator_count: 2, validator_count: 2,
stakers: initial_authorities stakers: initial_authorities
@@ -1434,19 +1434,19 @@ pub fn westend_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_babe: westend::BabeConfig { babe: westend::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(westend::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(westend::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_authority_discovery: westend::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: westend::AuthorityDiscoveryConfig { keys: vec![] },
pallet_vesting: westend::VestingConfig { vesting: vec![] }, vesting: westend::VestingConfig { vesting: vec![] },
pallet_sudo: westend::SudoConfig { key: root_key }, sudo: westend::SudoConfig { key: root_key },
parachains_configuration: westend::ParachainsConfigurationConfig { parachains_configuration: westend::ParachainsConfigurationConfig {
config: default_parachains_host_configuration(), config: default_parachains_host_configuration(),
}, },
parachains_paras: Default::default(), paras: Default::default(),
} }
} }
@@ -1473,18 +1473,18 @@ pub fn rococo_testnet_genesis(
const ENDOWMENT: u128 = 1_000_000 * DOT; const ENDOWMENT: u128 = 1_000_000 * DOT;
rococo_runtime::GenesisConfig { rococo_runtime::GenesisConfig {
frame_system: rococo_runtime::SystemConfig { system: rococo_runtime::SystemConfig {
code: wasm_binary.to_vec(), code: wasm_binary.to_vec(),
changes_trie_config: Default::default(), changes_trie_config: Default::default(),
}, },
pallet_beefy: Default::default(), beefy: Default::default(),
pallet_indices: rococo_runtime::IndicesConfig { indices: rococo_runtime::IndicesConfig {
indices: vec![], indices: vec![],
}, },
pallet_balances: rococo_runtime::BalancesConfig { balances: rococo_runtime::BalancesConfig {
balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(),
}, },
pallet_session: rococo_runtime::SessionConfig { session: rococo_runtime::SessionConfig {
keys: initial_authorities.iter().map(|x| ( keys: initial_authorities.iter().map(|x| (
x.0.clone(), x.0.clone(),
x.0.clone(), x.0.clone(),
@@ -1499,31 +1499,31 @@ pub fn rococo_testnet_genesis(
), ),
)).collect::<Vec<_>>(), )).collect::<Vec<_>>(),
}, },
pallet_babe: rococo_runtime::BabeConfig { babe: rococo_runtime::BabeConfig {
authorities: Default::default(), authorities: Default::default(),
epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_im_online: Default::default(), im_online: Default::default(),
pallet_collective: Default::default(), collective: Default::default(),
pallet_membership: Default::default(), membership: Default::default(),
pallet_authority_discovery: rococo_runtime::AuthorityDiscoveryConfig { authority_discovery: rococo_runtime::AuthorityDiscoveryConfig {
keys: vec![], keys: vec![],
}, },
pallet_sudo: rococo_runtime::SudoConfig { key: root_key.clone() }, sudo: rococo_runtime::SudoConfig { key: root_key.clone() },
parachains_configuration: rococo_runtime::ParachainsConfigurationConfig { parachains_configuration: rococo_runtime::ParachainsConfigurationConfig {
config: default_parachains_host_configuration(), config: default_parachains_host_configuration(),
}, },
parachains_hrmp: Default::default(), hrmp: Default::default(),
parachains_paras: rococo_runtime::ParasConfig { paras: rococo_runtime::ParasConfig {
paras: vec![], paras: vec![],
_phdata: Default::default(), _phdata: Default::default(),
}, },
pallet_bridge_grandpa: rococo_runtime::BridgeRococoGrandpaConfig { bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
owner: Some(root_key.clone()), owner: Some(root_key.clone()),
..Default::default() ..Default::default()
}, },
pallet_bridge_grandpa_Instance1: rococo_runtime::BridgeWococoGrandpaConfig { bridge_wococo_grandpa: rococo_runtime::BridgeWococoGrandpaConfig {
owner: Some(root_key.clone()), owner: Some(root_key.clone()),
..Default::default() ..Default::default()
}, },
+10 -10
View File
@@ -114,18 +114,18 @@ fn polkadot_testnet_genesis(
const STASH: u128 = 100 * DOTS; const STASH: u128 = 100 * DOTS;
runtime::GenesisConfig { runtime::GenesisConfig {
frame_system: runtime::SystemConfig { system: runtime::SystemConfig {
code: runtime::WASM_BINARY.expect("Wasm binary must be built for testing").to_vec(), code: runtime::WASM_BINARY.expect("Wasm binary must be built for testing").to_vec(),
..Default::default() ..Default::default()
}, },
pallet_indices: runtime::IndicesConfig { indices: vec![] }, indices: runtime::IndicesConfig { indices: vec![] },
pallet_balances: runtime::BalancesConfig { balances: runtime::BalancesConfig {
balances: endowed_accounts balances: endowed_accounts
.iter() .iter()
.map(|k| (k.clone(), ENDOWMENT)) .map(|k| (k.clone(), ENDOWMENT))
.collect(), .collect(),
}, },
pallet_session: runtime::SessionConfig { session: runtime::SessionConfig {
keys: initial_authorities keys: initial_authorities
.iter() .iter()
.map(|x| { .map(|x| {
@@ -143,7 +143,7 @@ fn polkadot_testnet_genesis(
}) })
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
}, },
pallet_staking: runtime::StakingConfig { staking: runtime::StakingConfig {
minimum_validator_count: 1, minimum_validator_count: 1,
validator_count: 2, validator_count: 2,
stakers: initial_authorities stakers: initial_authorities
@@ -162,18 +162,18 @@ fn polkadot_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10), slash_reward_fraction: Perbill::from_percent(10),
..Default::default() ..Default::default()
}, },
pallet_babe: runtime::BabeConfig { babe: runtime::BabeConfig {
authorities: vec![], authorities: vec![],
epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG), epoch_config: Some(BABE_GENESIS_EPOCH_CONFIG),
}, },
pallet_grandpa: Default::default(), grandpa: Default::default(),
pallet_authority_discovery: runtime::AuthorityDiscoveryConfig { keys: vec![] }, authority_discovery: runtime::AuthorityDiscoveryConfig { keys: vec![] },
claims: runtime::ClaimsConfig { claims: runtime::ClaimsConfig {
claims: vec![], claims: vec![],
vesting: vec![], vesting: vec![],
}, },
pallet_vesting: runtime::VestingConfig { vesting: vec![] }, vesting: runtime::VestingConfig { vesting: vec![] },
pallet_sudo: runtime::SudoConfig { key: root_key }, sudo: runtime::SudoConfig { key: root_key },
parachains_configuration: runtime::ParachainsConfigurationConfig { parachains_configuration: runtime::ParachainsConfigurationConfig {
config: polkadot_runtime_parachains::configuration::HostConfiguration { config: polkadot_runtime_parachains::configuration::HostConfiguration {
validation_upgrade_frequency: 10u32, validation_upgrade_frequency: 10u32,
+1 -1
View File
@@ -1638,7 +1638,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> { fn candidate_events() -> Vec<CandidateEvent<Hash>> {
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| { parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev { match ev {
Event::parachains_inclusion(ev) => { Event::ParasInclusion(ev) => {
Some(ev) Some(ev)
} }
_ => None, _ => None,
+3 -3
View File
@@ -1552,13 +1552,13 @@ mod tests {
Hrmp::hrmp_init_open_channel(para_a_origin.into(), para_b, 2, 8).unwrap(); Hrmp::hrmp_init_open_channel(para_a_origin.into(), para_b, 2, 8).unwrap();
assert_storage_consistency_exhaustive(); assert_storage_consistency_exhaustive();
assert!(System::events().iter().any(|record| assert!(System::events().iter().any(|record|
record.event == MockEvent::hrmp(Event::OpenChannelRequested(para_a, para_b, 2, 8)) record.event == MockEvent::Hrmp(Event::OpenChannelRequested(para_a, para_b, 2, 8))
)); ));
Hrmp::hrmp_accept_open_channel(para_b_origin.into(), para_a).unwrap(); Hrmp::hrmp_accept_open_channel(para_b_origin.into(), para_a).unwrap();
assert_storage_consistency_exhaustive(); assert_storage_consistency_exhaustive();
assert!(System::events().iter().any(|record| assert!(System::events().iter().any(|record|
record.event == MockEvent::hrmp(Event::OpenChannelAccepted(para_a, para_b)) record.event == MockEvent::Hrmp(Event::OpenChannelAccepted(para_a, para_b))
)); ));
// Advance to a block 6, but without session change. That means that the channel has // Advance to a block 6, but without session change. That means that the channel has
@@ -1605,7 +1605,7 @@ mod tests {
assert!(!channel_exists(para_a, para_b)); assert!(!channel_exists(para_a, para_b));
assert_storage_consistency_exhaustive(); assert_storage_consistency_exhaustive();
assert!(System::events().iter().any(|record| assert!(System::events().iter().any(|record|
record.event == MockEvent::hrmp(Event::ChannelClosed(para_b, channel_id.clone())) record.event == MockEvent::Hrmp(Event::ChannelClosed(para_b, channel_id.clone()))
)); ));
}); });
} }
+1 -1
View File
@@ -1120,7 +1120,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> { fn candidate_events() -> Vec<CandidateEvent<Hash>> {
runtime_api_impl::candidate_events::<Runtime, _>(|ev| { runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev { match ev {
Event::parachains_inclusion(ev) => { Event::Inclusion(ev) => {
Some(ev) Some(ev)
} }
_ => None, _ => None,
+1 -1
View File
@@ -1236,7 +1236,7 @@ sp_api::impl_runtime_apis! {
fn candidate_events() -> Vec<CandidateEvent<Hash>> { fn candidate_events() -> Vec<CandidateEvent<Hash>> {
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| { parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
match ev { match ev {
Event::parachains_inclusion(ev) => { Event::ParasInclusion(ev) => {
Some(ev) Some(ev)
} }
_ => None, _ => None,