diff --git a/node/cli/src/service.rs b/node/cli/src/service.rs index 0a9fbfddd..9d552b6c2 100644 --- a/node/cli/src/service.rs +++ b/node/cli/src/service.rs @@ -647,255 +647,3 @@ pub fn new_full(config: Configuration, cli: Cli) -> Result::Signer; - - #[test] - // It is "ignored", but the node-cli ignored tests are running on the CI. - // This can be run locally with `cargo test --release -p node-cli test_sync -- --ignored`. - #[ignore] - fn test_sync() { - sp_tracing::try_init_simple(); - - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore: KeystorePtr = - LocalKeystore::open(keystore_path.path(), None).expect("Creates keystore").into(); - let alice: sp_consensus_babe::AuthorityId = keystore - .sr25519_generate_new(BABE, Some("//Alice")) - .expect("Creates authority pair") - .into(); - - let chain_spec = crate::chain_spec::tests::integration_test_config_with_single_authority(); - - // For the block factory - let mut slot = 1u64; - - // For the extrinsics factory - let bob = Arc::new(AccountKeyring::Bob.pair()); - let charlie = Arc::new(AccountKeyring::Charlie.pair()); - let mut index = 0; - - sc_service_test::sync( - chain_spec, - |config| { - let mut setup_handles = None; - let NewFullBase { task_manager, client, network, sync, transaction_pool, .. } = - new_full_base( - config, - false, - |block_import: &sc_consensus_babe::BabeBlockImport, - babe_link: &sc_consensus_babe::BabeLink| { - setup_handles = Some((block_import.clone(), babe_link.clone())); - }, - None, - )?; - - let node = sc_service_test::TestNetComponents::new( - task_manager, - client, - network, - sync, - transaction_pool, - ); - Ok((node, setup_handles.unwrap())) - }, - |service, &mut (ref mut block_import, ref babe_link)| { - let parent_hash = service.client().chain_info().best_hash; - let parent_header = service.client().header(parent_hash).unwrap().unwrap(); - let parent_number = *parent_header.number(); - - futures::executor::block_on(service.transaction_pool().maintain( - ChainEvent::NewBestBlock { hash: parent_header.hash(), tree_route: None }, - )); - - let mut proposer_factory = sc_basic_authorship::ProposerFactory::new( - service.spawn_handle(), - service.client(), - service.transaction_pool(), - None, - None, - ); - - let mut digest = Digest::default(); - - // even though there's only one authority some slots might be empty, - // so we must keep trying the next slots until we can claim one. - let (babe_pre_digest, epoch_descriptor) = loop { - let epoch_descriptor = babe_link - .epoch_changes() - .shared_data() - .epoch_descriptor_for_child_of( - descendent_query(&*service.client()), - &parent_hash, - parent_number, - slot.into(), - ) - .unwrap() - .unwrap(); - - let epoch = babe_link - .epoch_changes() - .shared_data() - .epoch_data(&epoch_descriptor, |slot| { - sc_consensus_babe::Epoch::genesis(babe_link.config(), slot) - }) - .unwrap(); - - if let Some(babe_pre_digest) = - sc_consensus_babe::authorship::claim_slot(slot.into(), &epoch, &keystore) - .map(|(digest, _)| digest) - { - break (babe_pre_digest, epoch_descriptor); - } - - slot += 1; - }; - - let inherent_data = futures::executor::block_on( - ( - sp_timestamp::InherentDataProvider::new( - std::time::Duration::from_millis(SLOT_DURATION * slot).into(), - ), - sp_consensus_babe::inherents::InherentDataProvider::new(slot.into()), - ) - .create_inherent_data(), - ) - .expect("Creates inherent data"); - - digest.push(::babe_pre_digest(babe_pre_digest)); - - let new_block = futures::executor::block_on(async move { - let proposer = proposer_factory.init(&parent_header).await; - proposer - .unwrap() - .propose(inherent_data, digest, std::time::Duration::from_secs(1), None) - .await - }) - .expect("Error making test block") - .block; - - let (new_header, new_body) = new_block.deconstruct(); - let pre_hash = new_header.hash(); - // sign the pre-sealed hash of the block and then - // add it to a digest item. - let to_sign = pre_hash.encode(); - let signature = keystore - .sr25519_sign(sp_consensus_babe::AuthorityId::ID, alice.as_ref(), &to_sign) - .unwrap() - .unwrap(); - let item = ::babe_seal(signature.into()); - slot += 1; - - let mut params = BlockImportParams::new(BlockOrigin::File, new_header); - params.post_digests.push(item); - params.body = Some(new_body); - params.insert_intermediate( - INTERMEDIATE_KEY, - BabeIntermediate:: { epoch_descriptor }, - ); - params.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - futures::executor::block_on(block_import.import_block(params)) - .expect("error importing test block"); - }, - |service, _| { - let amount = 5 * CENTS; - let to: Address = AccountPublic::from(bob.public()).into_account().into(); - let from: Address = AccountPublic::from(charlie.public()).into_account().into(); - let genesis_hash = service.client().block_hash(0).unwrap().unwrap(); - let best_hash = service.client().chain_info().best_hash; - let (spec_version, transaction_version) = { - let version = service.client().runtime_version_at(best_hash).unwrap(); - (version.spec_version, version.transaction_version) - }; - let signer = charlie.clone(); - - let function = RuntimeCall::Balances(BalancesCall::transfer_allow_death { - dest: to, - value: amount, - }); - - let check_non_zero_sender = frame_system::CheckNonZeroSender::new(); - let check_spec_version = frame_system::CheckSpecVersion::new(); - let check_tx_version = frame_system::CheckTxVersion::new(); - let check_genesis = frame_system::CheckGenesis::new(); - let check_era = frame_system::CheckEra::from(Era::Immortal); - let check_nonce = frame_system::CheckNonce::from(index); - let check_weight = frame_system::CheckWeight::new(); - let tx_payment = pallet_asset_tx_payment::ChargeAssetTxPayment::from(0, None); - let extra = ( - check_non_zero_sender, - check_spec_version, - check_tx_version, - check_genesis, - check_era, - check_nonce, - check_weight, - tx_payment, - ); - let raw_payload = SignedPayload::from_raw( - function, - extra, - ((), spec_version, transaction_version, genesis_hash, genesis_hash, (), (), ()), - ); - let signature = raw_payload.using_encoded(|payload| signer.sign(payload)); - let (function, extra, _) = raw_payload.deconstruct(); - index += 1; - UncheckedExtrinsic::new_signed(function, from, signature.into(), extra).into() - }, - ); - } - - #[test] - #[ignore] - fn test_consensus() { - sp_tracing::try_init_simple(); - - sc_service_test::consensus( - crate::chain_spec::tests::integration_test_config_with_two_authorities(), - |config| { - let NewFullBase { task_manager, client, network, sync, transaction_pool, .. } = - new_full_base(config, false, |_, _| (), None)?; - Ok(sc_service_test::TestNetComponents::new( - task_manager, - client, - network, - sync, - transaction_pool, - )) - }, - vec!["//Alice".into(), "//Bob".into()], - ) - } -} diff --git a/pallets/relayer/src/mock.rs b/pallets/relayer/src/mock.rs index e14268695..82f041d5c 100644 --- a/pallets/relayer/src/mock.rs +++ b/pallets/relayer/src/mock.rs @@ -1,7 +1,7 @@ use frame_election_provider_support::{onchain, SequentialPhragmen, VoteWeight}; use frame_support::{ parameter_types, - traits::{ConstU32, FindAuthor, GenesisBuild, OneSessionHandler}, + traits::{ConstU32, FindAuthor, OneSessionHandler}, }; use frame_system as system; use pallet_session::historical as pallet_session_historical; @@ -9,16 +9,15 @@ use pallet_staking_extension::ServerInfo; use sp_core::H256; use sp_runtime::{ curve::PiecewiseLinear, - testing::{Header, TestXt, UintAuthorityId}, + testing::{TestXt, UintAuthorityId}, traits::{BlakeTwo256, ConvertInto, IdentityLookup}, - Perbill, + BuildStorage, Perbill, }; use sp_staking::{EraIndex, SessionIndex}; use crate as pallet_relayer; const NULL_ARR: [u8; 32] = [0; 32]; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type BlockNumber = u64; type AccountId = u64; @@ -26,22 +25,19 @@ type Balance = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Authorship: pallet_authorship::{Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Relayer: pallet_relayer::{Pallet, Call, Storage, Event}, - Staking: pallet_staking_extension::{Pallet, Call, Storage, Event, Config}, - FrameStaking: pallet_staking::{Pallet, Call, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Historical: pallet_session_historical::{Pallet}, - BagsList: pallet_bags_list::{Pallet, Call, Storage, Event}, - Constraints: pallet_constraints::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Authorship: pallet_authorship, + Timestamp: pallet_timestamp, + Relayer: pallet_relayer, + Staking: pallet_staking_extension, + FrameStaking: pallet_staking, + Session: pallet_session, + Historical: pallet_session_historical, + BagsList: pallet_bags_list, + Constraints: pallet_constraints, } ); @@ -54,17 +50,16 @@ impl system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = u64; type BaseCallFilter = frame_support::traits::Everything; + type Block = Block; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type DbWeight = (); type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; type Lookup = IdentityLookup; type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); @@ -98,13 +93,13 @@ impl pallet_balances::Config for Test { type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type FreezeIdentifier = (); - type HoldIdentifier = (); type MaxFreezes = (); type MaxHolds = (); type MaxLocks = MaxLocks; type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = (); } @@ -218,9 +213,10 @@ impl pallet_staking::Config for Test { type BondingDuration = BondingDuration; type Currency = Balances; type CurrencyBalance = Balance; - type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote; + type CurrencyToVote = (); type ElectionProvider = onchain::OnChainExecution; type EraPayout = pallet_staking::ConvertCurve; + type EventListeners = (); type GenesisElectionProvider = Self::ElectionProvider; type HistoryDepth = ConstU32<84>; type MaxNominations = MaxNominations; @@ -228,7 +224,6 @@ impl pallet_staking::Config for Test { type MaxUnlockingChunks = ConstU32<32>; type NextNewSession = Session; type OffendingValidatorsThreshold = OffendingValidatorsThreshold; - type OnStakerSlash = (); type Reward = (); type RewardRemainder = (); type RuntimeEvent = RuntimeEvent; @@ -314,7 +309,7 @@ impl pallet_constraints::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = system::GenesisConfig::::default().build_storage().unwrap(); let pallet_staking_extension = pallet_staking_extension::GenesisConfig:: { threshold_servers: vec![ (5, ServerInfo { tss_account: 7, x25519_public_key: NULL_ARR, endpoint: vec![20] }), diff --git a/pallets/slashing/src/mock.rs b/pallets/slashing/src/mock.rs index 922c897e4..9294f5f3d 100644 --- a/pallets/slashing/src/mock.rs +++ b/pallets/slashing/src/mock.rs @@ -3,16 +3,16 @@ use std::cell::RefCell; use frame_election_provider_support::{onchain, SequentialPhragmen, VoteWeight}; use frame_support::{ parameter_types, - traits::{ConstU32, GenesisBuild, OneSessionHandler}, + traits::{ConstU32, OneSessionHandler}, }; use frame_system as system; use pallet_session::historical as pallet_session_historical; use sp_core::H256; use sp_runtime::{ curve::PiecewiseLinear, - testing::{Header, TestXt, UintAuthorityId}, + testing::{TestXt, UintAuthorityId}, traits::{BlakeTwo256, ConvertInto, IdentityLookup}, - Perbill, + BuildStorage, Perbill, }; use sp_staking::{ offence::{OffenceError, ReportOffence}, @@ -21,25 +21,21 @@ use sp_staking::{ use crate as pallet_slashing; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Slashing: pallet_slashing::{Pallet, Call, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Historical: pallet_session_historical::{Pallet}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Staking: pallet_staking::{Pallet, Call, Storage, Config, Event}, - BagsList: pallet_bags_list::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Slashing: pallet_slashing, + Session: pallet_session, + Historical: pallet_session_historical, + Timestamp: pallet_timestamp, + Staking: pallet_staking, + BagsList: pallet_bags_list, } ); type AccountId = u64; @@ -50,20 +46,19 @@ parameter_types! { } impl system::Config for Test { - type AccountData = pallet_balances::AccountData; - type AccountId = AccountId; + type AccountData = pallet_balances::AccountData; + type AccountId = u64; type BaseCallFilter = frame_support::traits::Everything; + type Block = Block; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type DbWeight = (); type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; type Lookup = IdentityLookup; type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); @@ -204,9 +199,10 @@ impl pallet_staking::Config for Test { type BondingDuration = BondingDuration; type Currency = Balances; type CurrencyBalance = Balance; - type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote; + type CurrencyToVote = (); type ElectionProvider = onchain::OnChainExecution; type EraPayout = pallet_staking::ConvertCurve; + type EventListeners = (); type GenesisElectionProvider = Self::ElectionProvider; type HistoryDepth = ConstU32<84>; type MaxNominations = MaxNominations; @@ -214,7 +210,6 @@ impl pallet_staking::Config for Test { type MaxUnlockingChunks = ConstU32<32>; type NextNewSession = Session; type OffendingValidatorsThreshold = OffendingValidatorsThreshold; - type OnStakerSlash = (); type Reward = (); type RewardRemainder = (); type RuntimeEvent = RuntimeEvent; @@ -238,13 +233,13 @@ impl pallet_balances::Config for Test { type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type FreezeIdentifier = (); - type HoldIdentifier = (); type MaxFreezes = (); type MaxHolds = (); type MaxLocks = (); type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = (); } @@ -298,7 +293,7 @@ impl pallet_slashing::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut storage = system::GenesisConfig::default().build_storage::().unwrap(); + let mut storage = system::GenesisConfig::::default().build_storage().unwrap(); let _ = pallet_session::GenesisConfig:: { keys: (0..5).map(|id| (id, id, SessionKeys { foo: id.into() })).collect(), } diff --git a/pallets/staking/src/mock.rs b/pallets/staking/src/mock.rs index 7dab5336a..9225d9460 100644 --- a/pallets/staking/src/mock.rs +++ b/pallets/staking/src/mock.rs @@ -4,7 +4,7 @@ use std::cell::RefCell; use frame_election_provider_support::{onchain, SequentialPhragmen, VoteWeight}; use frame_support::{ parameter_types, - traits::{ConstU32, GenesisBuild, Get, Hooks, OneSessionHandler}, + traits::{ConstU32, Get, Hooks, OneSessionHandler}, }; use frame_system as system; use pallet_session::{historical as pallet_session_historical, ShouldEndSession}; @@ -13,15 +13,14 @@ use pallet_staking_extension::ServerInfo; use sp_core::H256; use sp_runtime::{ curve::PiecewiseLinear, - testing::{Header, TestXt, UintAuthorityId}, + testing::{TestXt, UintAuthorityId}, traits::{BlakeTwo256, ConvertInto, IdentityLookup, OpaqueKeys, Zero}, - KeyTypeId, Perbill, + BuildStorage, KeyTypeId, Perbill, }; use sp_staking::{EraIndex, SessionIndex}; use crate as pallet_staking_extension; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type BlockNumber = u64; @@ -33,19 +32,16 @@ pub const KEY_ID_A: KeyTypeId = KeyTypeId([4; 4]); pub const KEY_ID_B: KeyTypeId = KeyTypeId([9; 4]); // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Staking: pallet_staking_extension::{Pallet, Call, Storage, Event, Config}, - FrameStaking: pallet_staking::{Pallet, Call, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Historical: pallet_session_historical::{Pallet}, - BagsList: pallet_bags_list::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Timestamp: pallet_timestamp, + Staking: pallet_staking_extension, + FrameStaking: pallet_staking, + Session: pallet_session, + Historical: pallet_session_historical, + BagsList: pallet_bags_list, } ); @@ -66,19 +62,18 @@ parameter_types! { impl system::Config for Test { type AccountData = pallet_balances::AccountData; - type AccountId = AccountId; + type AccountId = u64; type BaseCallFilter = frame_support::traits::Everything; + type Block = Block; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type DbWeight = (); type Hash = H256; type Hashing = BlakeTwo256; - type Header = Header; - type Index = u64; type Lookup = IdentityLookup; type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); @@ -112,13 +107,13 @@ impl pallet_balances::Config for Test { type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type FreezeIdentifier = (); - type HoldIdentifier = (); type MaxFreezes = (); type MaxHolds = (); type MaxLocks = MaxLocks; type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = (); } @@ -284,9 +279,10 @@ impl pallet_staking::Config for Test { type BondingDuration = BondingDuration; type Currency = Balances; type CurrencyBalance = Balance; - type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote; + type CurrencyToVote = (); type ElectionProvider = onchain::OnChainExecution; type EraPayout = pallet_staking::ConvertCurve; + type EventListeners = (); type GenesisElectionProvider = Self::ElectionProvider; type HistoryDepth = ConstU32<84>; type MaxNominations = MaxNominations; @@ -294,7 +290,6 @@ impl pallet_staking::Config for Test { type MaxUnlockingChunks = ConstU32<32>; type NextNewSession = Session; type OffendingValidatorsThreshold = OffendingValidatorsThreshold; - type OnStakerSlash = (); type Reward = (); type RewardRemainder = (); type RuntimeEvent = RuntimeEvent; @@ -351,7 +346,7 @@ impl pallet_staking_extension::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = system::GenesisConfig::::default().build_storage().unwrap(); let pallet_balances = pallet_balances::GenesisConfig:: { balances: vec![(1, 100), (2, 100), (3, 100), (4, 100)], }; diff --git a/pallets/transaction-pause/src/mock.rs b/pallets/transaction-pause/src/mock.rs index aeac83755..1fdebe2cc 100644 --- a/pallets/transaction-pause/src/mock.rs +++ b/pallets/transaction-pause/src/mock.rs @@ -22,11 +22,11 @@ use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, - traits::{ConstU128, ConstU32, ConstU64, Everything}, + traits::{ConstU128, ConstU64, Everything}, }; use frame_system::EnsureSignedBy; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use super::*; @@ -42,17 +42,16 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; type BaseCallFilter = Everything; + type Block = Block; type BlockHashCount = ConstU64<250>; type BlockLength = (); - type BlockNumber = u64; type BlockWeights = (); type DbWeight = (); type Hash = H256; - type Hashing = ::sp_runtime::traits::BlakeTwo256; - type Header = Header; - type Index = u64; - type Lookup = IdentityLookup; - type MaxConsumers = ConstU32<16>; + type Hashing = sp_runtime::traits::BlakeTwo256; + type Lookup = IdentityLookup; + type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); @@ -71,13 +70,13 @@ impl pallet_balances::Config for Runtime { type DustRemoval = (); type ExistentialDeposit = ConstU128<10>; type FreezeIdentifier = (); - type HoldIdentifier = (); type MaxFreezes = (); type MaxHolds = (); type MaxLocks = (); - type MaxReserves = ConstU32<50>; - type ReserveIdentifier = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = (); } @@ -103,19 +102,15 @@ impl Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic + pub enum Runtime { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - TransactionPause: transaction_pause::{Pallet, Storage, Call, Event}, - Balances: pallet_balances::{Pallet, Storage, Call, Event}, - ConstraintsPallet: pallet_constraints::{Pallet, Call, Storage, Event}, + System: frame_system, + TransactionPause: transaction_pause, + Balances: pallet_balances, + ConstraintsPallet: pallet_constraints, } ); @@ -127,8 +122,6 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - t.into() + frame_system::GenesisConfig::::default().build_storage().unwrap().into() } } diff --git a/runtime/src/impls.rs b/runtime/src/impls.rs index 14701f1dd..e0a778b87 100644 --- a/runtime/src/impls.rs +++ b/runtime/src/impls.rs @@ -41,7 +41,7 @@ mod multiplier_tests { use sp_runtime::{ assert_eq_error_rate, traits::{Convert, One, Zero}, - FixedPointNumber, + BuildStorage, FixedPointNumber, }; use crate::{ @@ -98,7 +98,7 @@ mod multiplier_tests { fn run_with_system_weight(w: Weight, assertions: F) where F: Fn() { let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::::default().build_storage().unwrap().into(); t.execute_with(|| { System::set_block_consumed_resources(w, 0); assertions()