From d53d7957619e15495d1e94ebb3c28df71697e31e Mon Sep 17 00:00:00 2001 From: runcomet Date: Sat, 30 Nov 2024 16:17:34 -0800 Subject: [PATCH] adjust genesisconfig addition --- .../src/genesis_config_presets.rs | 3 +-- .../src/genesis_config_presets.rs | 3 +-- .../src/genesis_config_presets.rs | 3 +-- .../src/genesis_config_presets.rs | 3 +-- .../src/genesis_config_presets.rs | 3 +-- .../parachains/runtimes/test-utils/src/lib.rs | 2 +- .../rococo/src/genesis_config_presets.rs | 6 ++---- .../westend/src/genesis_config_presets.rs | 6 ++---- prdoc/pr_6267.prdoc | 18 ++---------------- substrate/bin/node/testing/src/genesis.rs | 2 +- substrate/frame/balances/src/lib.rs | 3 ++- substrate/test-utils/runtime/Cargo.toml | 2 +- 12 files changed, 16 insertions(+), 38 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs index 36fe0126657c..8f029a5b808d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/genesis_config_presets.rs @@ -36,8 +36,7 @@ fn asset_hub_rococo_genesis( ) -> serde_json::Value { build_struct_json_patch!(RuntimeGenesisConfig { balances: BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect(), - ..Default::default() + balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect() }, parachain_info: ParachainInfoConfig { parachain_id: id }, collator_selection: CollatorSelectionConfig { diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/genesis_config_presets.rs index e9837581eeec..d1d98f9d656d 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/genesis_config_presets.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/genesis_config_presets.rs @@ -38,8 +38,7 @@ fn asset_hub_westend_genesis( ) -> serde_json::Value { build_struct_json_patch!(RuntimeGenesisConfig { balances: BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect(), - ..Default::default() + balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect() }, parachain_info: ParachainInfoConfig { parachain_id: id }, collator_selection: CollatorSelectionConfig { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/genesis_config_presets.rs index f0373b5df467..22993ef703a7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/genesis_config_presets.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/genesis_config_presets.rs @@ -41,8 +41,7 @@ fn bridge_hub_rococo_genesis( .iter() .cloned() .map(|k| (k, 1u128 << 60)) - .collect::>(), - ..Default::default() + .collect::>() }, parachain_info: ParachainInfoConfig { parachain_id: id }, collator_selection: CollatorSelectionConfig { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/genesis_config_presets.rs index 9ef8bbb2455f..8a5e96ed9cf7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/genesis_config_presets.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/genesis_config_presets.rs @@ -41,8 +41,7 @@ fn bridge_hub_westend_genesis( .iter() .cloned() .map(|k| (k, 1u128 << 60)) - .collect::>(), - ..Default::default() + .collect::>() }, parachain_info: ParachainInfoConfig { parachain_id: id }, collator_selection: CollatorSelectionConfig { diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/genesis_config_presets.rs index fee0f2b6f8a7..cb75c43b82b5 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/genesis_config_presets.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/genesis_config_presets.rs @@ -37,8 +37,7 @@ fn collectives_westend_genesis( .iter() .cloned() .map(|k| (k, COLLECTIVES_WESTEND_ED * 4096)) - .collect::>(), - ..Default::default() + .collect::>() }, parachain_info: ParachainInfoConfig { parachain_id: id }, collator_selection: CollatorSelectionConfig { diff --git a/cumulus/parachains/runtimes/test-utils/src/lib.rs b/cumulus/parachains/runtimes/test-utils/src/lib.rs index 27691c60d363..3f2e721d13f6 100644 --- a/cumulus/parachains/runtimes/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/test-utils/src/lib.rs @@ -230,7 +230,7 @@ impl ExtBuilder { .unwrap(); } - pallet_balances::GenesisConfig:: { balances: self.balances, ..Default::default() } + pallet_balances::GenesisConfig:: { balances: self.balances } .assimilate_storage(&mut t) .unwrap(); diff --git a/polkadot/runtime/rococo/src/genesis_config_presets.rs b/polkadot/runtime/rococo/src/genesis_config_presets.rs index d45cf8d91119..dcaf578fd418 100644 --- a/polkadot/runtime/rococo/src/genesis_config_presets.rs +++ b/polkadot/runtime/rococo/src/genesis_config_presets.rs @@ -166,8 +166,7 @@ fn rococo_testnet_genesis( build_struct_json_patch!(RuntimeGenesisConfig { balances: BalancesConfig { - balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect::>(), - ..Default::default() + balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect::>() }, session: SessionConfig { keys: initial_authorities @@ -428,8 +427,7 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value { .iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) - .collect::>(), - ..Default::default() + .collect::>() }, session: SessionConfig { keys: initial_authorities diff --git a/polkadot/runtime/westend/src/genesis_config_presets.rs b/polkadot/runtime/westend/src/genesis_config_presets.rs index ebacae8b8d41..2cf71d5187bb 100644 --- a/polkadot/runtime/westend/src/genesis_config_presets.rs +++ b/polkadot/runtime/westend/src/genesis_config_presets.rs @@ -173,8 +173,7 @@ fn westend_testnet_genesis( build_struct_json_patch!(RuntimeGenesisConfig { balances: BalancesConfig { - balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect::>(), - ..Default::default() + balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect::>() }, session: SessionConfig { keys: initial_authorities @@ -345,8 +344,7 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value { .iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) - .collect::>(), - ..Default::default() + .collect::>() }, session: SessionConfig { keys: initial_authorities diff --git a/prdoc/pr_6267.prdoc b/prdoc/pr_6267.prdoc index c218e2a5093b..e5d7e4cb937b 100644 --- a/prdoc/pr_6267.prdoc +++ b/prdoc/pr_6267.prdoc @@ -97,6 +97,8 @@ crates: bump: minor - name: pallet-asset-conversion bump: minor + - name: pallet-asset-conversion-ops + bump: minor - name: pallet-alliance bump: minor - name: node-testing @@ -111,24 +113,8 @@ crates: bump: minor - name: pallet-xcm bump: minor - - name: westend-runtime - bump: minor - - name: rococo-runtime - bump: minor - name: polkadot-runtime-common bump: minor - - name: parachains-runtimes-test-utils - bump: minor - - name: collectives-westend-runtime - bump: minor - - name: bridge-hub-westend-runtime - bump: minor - - name: bridge-hub-rococo-runtime - bump: minor - - name: asset-hub-westend-runtime - bump: minor - - name: asset-hub-rococo-runtime - bump: minor - name: pallet-collator-selection bump: minor - name: pallet-bridge-messages diff --git a/substrate/bin/node/testing/src/genesis.rs b/substrate/bin/node/testing/src/genesis.rs index 606349e0bd6b..7f5364744c66 100644 --- a/substrate/bin/node/testing/src/genesis.rs +++ b/substrate/bin/node/testing/src/genesis.rs @@ -47,7 +47,7 @@ pub fn config_endowed(extra_endowed: Vec) -> RuntimeGenesisConfig { RuntimeGenesisConfig { indices: IndicesConfig { indices: vec![] }, - balances: BalancesConfig { balances: endowed, ..Default::default() }, + balances: BalancesConfig { balances: endowed }, session: SessionConfig { keys: vec![ (alice(), dave(), session_keys_from_seed(Ed25519Keyring::Alice.into())), diff --git a/substrate/frame/balances/src/lib.rs b/substrate/frame/balances/src/lib.rs index c79ea186487a..e875796af16e 100644 --- a/substrate/frame/balances/src/lib.rs +++ b/substrate/frame/balances/src/lib.rs @@ -183,6 +183,7 @@ use sp_runtime::{ #[cfg(feature = "runtime-benchmarks")] use sp_core::{sr25519::Pair as SrPair, Pair}; +#[cfg(feature = "runtime-benchmarks")] use alloc::{format, string::{String, ToString}}; pub use types::{ @@ -521,7 +522,7 @@ pub mod pallet { balances: Default::default(), #[cfg(feature = "runtime-benchmarks")] - dev_accounts: (One::one(), >::ExistentialDeposit::get(), None), + dev_accounts: (One::one(), >::ExistentialDeposit::get(), Some("//Sender/{}".to_string())), } } } diff --git a/substrate/test-utils/runtime/Cargo.toml b/substrate/test-utils/runtime/Cargo.toml index 96a888052876..1412d4b164e0 100644 --- a/substrate/test-utils/runtime/Cargo.toml +++ b/substrate/test-utils/runtime/Cargo.toml @@ -35,7 +35,7 @@ sp-session = { workspace = true } sp-api = { workspace = true } sp-runtime = { features = ["serde"], workspace = true } pallet-babe = { workspace = true } -pallet-balances = { workspace = true } +pallet-balances = { workspace = true, features = ["runtime-benchmarks"] } frame-executive = { workspace = true } frame-metadata-hash-extension = { workspace = true } frame-system = { workspace = true }