From adc9e76a9f8a3d32e1f09192efcfc6ca17af88bf Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Wed, 2 Aug 2023 00:18:08 +0530 Subject: [PATCH] fix: change GenesisConfig -> RuntimeGenesisConfig. --- Cargo.lock | 30 +++++++++---------- .../src/relaychain/kusama_test_net.rs | 26 ++++++++-------- .../src/relaychain/polkadot_test_net.rs | 26 ++++++++-------- parachain/src/chain_spec/interlay.rs | 8 ++--- parachain/src/chain_spec/kintsugi.rs | 8 ++--- 5 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53570ff7a7..9d60ac1964 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17452,21 +17452,6 @@ dependencies = [ "pkg-config", ] -[[patch.unused]] -name = "polkadot-test-runtime" -version = "1.0.0" -source = "git+https://github.com/paritytech//polkadot?rev=1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" - -[[patch.unused]] -name = "polkadot-test-service" -version = "1.0.0" -source = "git+https://github.com/paritytech//polkadot?rev=1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" - -[[patch.unused]] -name = "test-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/paritytech//polkadot?rev=1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" - [[patch.unused]] name = "asset-hub-kusama-runtime" version = "0.9.420" @@ -17542,6 +17527,21 @@ name = "substrate-test-utils-derive" version = "0.10.0-dev" source = "git+https://github.com/paritytech//substrate?rev=6d28d2eb6fa1589105e970ff1b97555d91a1495b#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +[[patch.unused]] +name = "polkadot-test-runtime" +version = "1.0.0" +source = "git+https://github.com/paritytech//polkadot?rev=1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" + +[[patch.unused]] +name = "polkadot-test-service" +version = "1.0.0" +source = "git+https://github.com/paritytech//polkadot?rev=1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" + +[[patch.unused]] +name = "test-runtime-constants" +version = "1.0.0" +source = "git+https://github.com/paritytech//polkadot?rev=1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" + [[patch.unused]] name = "fc-cli" version = "1.0.0-dev" diff --git a/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs b/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs index 8e68f57efb..369f3271cd 100644 --- a/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs +++ b/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs @@ -94,11 +94,11 @@ pub fn kusama_ext() -> sp_io::TestExternalities { use kusama_runtime::{Runtime, System}; use polkadot_parachain::primitives::{HeadData, ValidationCode}; - let mut t = frame_system::GenesisConfig::default() + let mut t = frame_system::RuntimeGenesisConfig::default() .build_storage::() .unwrap(); - pallet_balances::GenesisConfig:: { + pallet_balances::RuntimeGenesisConfig:: { balances: vec![ (AccountId::from(ALICE), 2002 * KSM.one()), // (ParaId::from(KINTSUGI_PARA_ID).into_account_truncating(), 2 * KSM.one()), @@ -113,8 +113,8 @@ pub fn kusama_ext() -> sp_io::TestExternalities { para_kind: ParaKind::Parachain, validation_code: ValidationCode(vec![0]), }; - >::assimilate_storage( - &polkadot_runtime_parachains::paras::GenesisConfig { + >::assimilate_storage( + &polkadot_runtime_parachains::paras::RuntimeGenesisConfig { paras: vec![ (KINTSUGI_PARA_ID.into(), fake_para.clone()), (SIBLING_PARA_ID.into(), fake_para.clone()), @@ -124,14 +124,14 @@ pub fn kusama_ext() -> sp_io::TestExternalities { ) .unwrap(); - polkadot_runtime_parachains::configuration::GenesisConfig:: { + polkadot_runtime_parachains::configuration::RuntimeGenesisConfig:: { config: default_parachains_host_configuration(), } .assimilate_storage(&mut t) .unwrap(); - >::assimilate_storage( - &pallet_xcm::GenesisConfig { + >::assimilate_storage( + &pallet_xcm::RuntimeGenesisConfig { safe_xcm_version: Some(3), }, &mut t, @@ -187,13 +187,13 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() + let mut t = frame_system::RuntimeGenesisConfig::default() .build_storage::() .unwrap(); let native_currency_id = GetNativeCurrencyId::get(); - orml_tokens::GenesisConfig:: { + orml_tokens::RuntimeGenesisConfig:: { balances: self .balances .into_iter() @@ -203,16 +203,16 @@ impl ExtBuilder { .assimilate_storage(&mut t) .unwrap(); - >::assimilate_storage( - ¶chain_info::GenesisConfig { + >::assimilate_storage( + ¶chain_info::RuntimeGenesisConfig { parachain_id: self.parachain_id.into(), }, &mut t, ) .unwrap(); - >::assimilate_storage( - &pallet_xcm::GenesisConfig { + >::assimilate_storage( + &pallet_xcm::RuntimeGenesisConfig { safe_xcm_version: Some(2), // NOTE! if this was required for tests we may need it on mainnet }, &mut t, diff --git a/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs b/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs index 26bfdd7a04..5d3068398e 100644 --- a/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs +++ b/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs @@ -103,11 +103,11 @@ pub fn polkadot_ext() -> sp_io::TestExternalities { use polkadot_parachain::primitives::{HeadData, ValidationCode}; use polkadot_runtime::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default() + let mut t = frame_system::RuntimeGenesisConfig::default() .build_storage::() .unwrap(); - pallet_balances::GenesisConfig:: { + pallet_balances::RuntimeGenesisConfig:: { balances: vec![(AccountId::from(ALICE), 100_000_000 * DOT.one())], } .assimilate_storage(&mut t) @@ -119,8 +119,8 @@ pub fn polkadot_ext() -> sp_io::TestExternalities { para_kind: ParaKind::Parachain, validation_code: ValidationCode(vec![0]), }; - >::assimilate_storage( - &polkadot_runtime_parachains::paras::GenesisConfig { + >::assimilate_storage( + &polkadot_runtime_parachains::paras::RuntimeGenesisConfig { paras: vec![ (INTERLAY_PARA_ID.into(), fake_para.clone()), (SIBLING_PARA_ID.into(), fake_para.clone()), @@ -130,14 +130,14 @@ pub fn polkadot_ext() -> sp_io::TestExternalities { ) .unwrap(); - polkadot_runtime_parachains::configuration::GenesisConfig:: { + polkadot_runtime_parachains::configuration::RuntimeGenesisConfig:: { config: default_parachains_host_configuration(), } .assimilate_storage(&mut t) .unwrap(); - >::assimilate_storage( - &pallet_xcm::GenesisConfig { + >::assimilate_storage( + &pallet_xcm::RuntimeGenesisConfig { safe_xcm_version: Some(3), }, &mut t, @@ -190,13 +190,13 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() + let mut t = frame_system::RuntimeGenesisConfig::default() .build_storage::() .unwrap(); let native_currency_id = GetNativeCurrencyId::get(); - orml_tokens::GenesisConfig:: { + orml_tokens::RuntimeGenesisConfig:: { balances: self .balances .into_iter() @@ -206,16 +206,16 @@ impl ExtBuilder { .assimilate_storage(&mut t) .unwrap(); - >::assimilate_storage( - ¶chain_info::GenesisConfig { + >::assimilate_storage( + ¶chain_info::RuntimeGenesisConfig { parachain_id: self.parachain_id.into(), }, &mut t, ) .unwrap(); - >::assimilate_storage( - &pallet_xcm::GenesisConfig { + >::assimilate_storage( + &pallet_xcm::RuntimeGenesisConfig { safe_xcm_version: Some(2), }, &mut t, diff --git a/parachain/src/chain_spec/interlay.rs b/parachain/src/chain_spec/interlay.rs index 827bf39191..dbc72c474c 100644 --- a/parachain/src/chain_spec/interlay.rs +++ b/parachain/src/chain_spec/interlay.rs @@ -3,7 +3,7 @@ use super::*; pub const PARA_ID: u32 = 2032; /// Specialized `ChainSpec` for the interlay parachain runtime. -pub type InterlayChainSpec = sc_service::GenericChainSpec; +pub type InterlayChainSpec = sc_service::GenericChainSpec; /// Specialized `ChainSpec` for interlay development. pub type InterlayDevChainSpec = sc_service::GenericChainSpec; @@ -12,7 +12,7 @@ pub type InterlayDevChainSpec = sc_service::GenericChainSpec interlay_runtime::GenesisConfig { +) -> interlay_runtime::RuntimeGenesisConfig { let chain_id: u32 = id.into(); endowed_accounts.extend( endowed_evm_accounts .into_iter() .map(|addr| interlay_runtime::evm::AccountConverter::into_account_id(H160::from(addr))), ); - interlay_runtime::GenesisConfig { + interlay_runtime::RuntimeGenesisConfig { system: interlay_runtime::SystemConfig { code: interlay_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") diff --git a/parachain/src/chain_spec/kintsugi.rs b/parachain/src/chain_spec/kintsugi.rs index a77c2ee6ab..b439a12743 100644 --- a/parachain/src/chain_spec/kintsugi.rs +++ b/parachain/src/chain_spec/kintsugi.rs @@ -3,7 +3,7 @@ use super::*; pub const PARA_ID: u32 = 2092; /// Specialized `ChainSpec` for the kintsugi parachain runtime. -pub type KintsugiChainSpec = sc_service::GenericChainSpec; +pub type KintsugiChainSpec = sc_service::GenericChainSpec; /// Specialized `ChainSpec` for kintsugi development. pub type KintsugiDevChainSpec = sc_service::GenericChainSpec; @@ -12,7 +12,7 @@ pub type KintsugiDevChainSpec = sc_service::GenericChainSpec kintsugi_runtime::GenesisConfig { +) -> kintsugi_runtime::RuntimeGenesisConfig { let chain_id: u32 = id.into(); endowed_accounts.extend( endowed_evm_accounts .into_iter() .map(|addr| kintsugi_runtime::evm::AccountConverter::into_account_id(H160::from(addr))), ); - kintsugi_runtime::GenesisConfig { + kintsugi_runtime::RuntimeGenesisConfig { system: kintsugi_runtime::SystemConfig { code: kintsugi_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!")