From 53c113cbf2a5cd60bf153767a69b9b3fe92a2af6 Mon Sep 17 00:00:00 2001 From: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Date: Mon, 22 Jan 2024 08:15:53 +0100 Subject: [PATCH] Switch All `construct_runtime`s to New Syntax (#2979) Clean up all the old syntax. --------- Co-authored-by: command-bot <> Co-authored-by: gupnik Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com> Co-authored-by: Maksym H <1177472+mordamax@users.noreply.github.com> --- substrate/bin/minimal/runtime/src/lib.rs | 2 +- .../bin/node-template/runtime/src/lib.rs | 2 +- substrate/bin/node/runtime/src/lib.rs | 11 ++++---- substrate/frame/assets/src/mock.rs | 6 ++--- substrate/frame/atomic-swap/src/tests.rs | 6 ++--- substrate/frame/aura/src/mock.rs | 6 ++--- .../frame/authority-discovery/src/lib.rs | 6 ++--- substrate/frame/authorship/src/lib.rs | 4 +-- substrate/frame/bags-list/src/mock.rs | 7 +++-- substrate/frame/balances/src/tests/mod.rs | 9 +++---- substrate/frame/beefy-mmr/src/mock.rs | 10 +++---- .../benchmarking/pov/src/benchmarking.rs | 4 +-- substrate/frame/benchmarking/pov/src/tests.rs | 4 +-- substrate/frame/benchmarking/src/baseline.rs | 2 +- substrate/frame/benchmarking/src/tests.rs | 4 +-- .../frame/benchmarking/src/tests_instance.rs | 4 +-- substrate/frame/bounties/src/tests.rs | 12 ++++----- substrate/frame/child-bounties/src/tests.rs | 10 +++---- substrate/frame/collective/src/tests.rs | 11 ++++---- .../contracts/mock-network/src/relay_chain.rs | 10 +++---- substrate/frame/contracts/src/tests.rs | 14 +++++----- .../frame/conviction-voting/src/tests.rs | 6 ++--- substrate/frame/core-fellowship/src/tests.rs | 4 +-- substrate/frame/democracy/src/tests.rs | 8 +++--- .../election-provider-multi-phase/src/mock.rs | 9 +++---- .../election-provider-support/src/onchain.rs | 5 ++-- substrate/frame/elections-phragmen/src/lib.rs | 7 ++--- substrate/frame/examples/basic/src/tests.rs | 6 ++--- .../frame/examples/default-config/src/lib.rs | 2 +- .../frame/examples/dev-mode/src/tests.rs | 6 ++--- .../frame/examples/frame-crate/src/lib.rs | 2 +- .../examples/offchain-worker/src/tests.rs | 4 +-- substrate/frame/examples/tasks/src/mock.rs | 2 +- substrate/frame/executive/src/lib.rs | 11 ++++---- substrate/frame/fast-unstake/src/mock.rs | 2 +- substrate/frame/glutton/src/mock.rs | 4 +-- substrate/frame/identity/src/tests.rs | 6 ++--- substrate/frame/im-online/src/mock.rs | 11 ++++---- substrate/frame/indices/src/mock.rs | 6 ++--- .../src/lib.rs | 4 +-- substrate/frame/lottery/src/mock.rs | 6 ++--- substrate/frame/membership/src/lib.rs | 4 +-- .../frame/merkle-mountain-range/src/mock.rs | 4 +-- .../message-queue/src/integration_test.rs | 4 +-- substrate/frame/message-queue/src/mock.rs | 4 +-- substrate/frame/multisig/src/tests.rs | 6 ++--- substrate/frame/nfts/src/mock.rs | 6 ++--- .../frame/node-authorization/src/mock.rs | 6 ++--- .../nomination-pools/benchmarking/src/mock.rs | 15 +++++------ substrate/frame/nomination-pools/src/mock.rs | 9 +++---- .../nomination-pools/test-staking/src/mock.rs | 15 +++++------ .../frame/offences/benchmarking/src/mock.rs | 6 ++--- substrate/frame/offences/src/mock.rs | 7 +++-- substrate/frame/proxy/src/tests.rs | 8 +++--- .../frame/ranked-collective/src/tests.rs | 4 +-- substrate/frame/recovery/src/mock.rs | 6 ++--- substrate/frame/remark/src/mock.rs | 4 +-- substrate/frame/root-offences/src/mock.rs | 14 +++++----- substrate/frame/salary/src/tests.rs | 4 +-- substrate/frame/scheduler/src/mock.rs | 8 +++--- substrate/frame/scored-pool/src/mock.rs | 6 ++--- .../frame/session/benchmarking/src/mock.rs | 8 +++--- substrate/frame/session/src/mock.rs | 10 +++---- substrate/frame/society/src/mock.rs | 6 ++--- .../frame/state-trie-migration/src/lib.rs | 6 ++--- substrate/frame/sudo/src/mock.rs | 6 ++--- .../procedural/src/construct_runtime/mod.rs | 6 ++--- substrate/frame/support/src/lib.rs | 2 +- substrate/frame/support/src/migrations.rs | 6 ++--- .../support/test/compile_pass/src/lib.rs | 2 +- .../support/test/stg_frame_crate/src/lib.rs | 4 +-- .../missing_system_module.stderr | 2 +- .../pass/composite_enum_instance.rs | 2 +- .../frame/support/test/tests/final_keys.rs | 1 - .../frame/support/test/tests/instance.rs | 27 +++++++------------ .../frame/support/test/tests/issue2219.rs | 2 +- .../pallet_ui/pass/no_std_genesis_config.rs | 4 +-- .../support/test/tests/storage_layers.rs | 2 +- .../support/test/tests/versioned_migration.rs | 4 +-- substrate/frame/system/benches/bench.rs | 7 +++-- .../frame/system/benchmarking/src/mock.rs | 2 +- substrate/frame/system/src/mock.rs | 2 +- substrate/frame/timestamp/src/mock.rs | 4 +-- substrate/frame/tips/src/tests.rs | 12 ++++----- .../asset-tx-payment/src/mock.rs | 2 +- .../skip-feeless-payment/src/mock.rs | 2 +- .../frame/transaction-payment/src/mock.rs | 4 +-- .../frame/transaction-storage/src/mock.rs | 8 +++--- substrate/frame/treasury/src/tests.rs | 6 ++--- substrate/frame/uniques/src/mock.rs | 6 ++--- substrate/frame/utility/src/tests.rs | 14 +++++----- substrate/frame/vesting/src/mock.rs | 6 ++--- substrate/primitives/api/src/lib.rs | 4 +-- .../api/test/tests/decl_and_impl.rs | 2 +- substrate/utils/frame/rpc/support/src/lib.rs | 4 +-- 95 files changed, 278 insertions(+), 302 deletions(-) diff --git a/substrate/bin/minimal/runtime/src/lib.rs b/substrate/bin/minimal/runtime/src/lib.rs index efee400c3f594..610289693d91b 100644 --- a/substrate/bin/minimal/runtime/src/lib.rs +++ b/substrate/bin/minimal/runtime/src/lib.rs @@ -63,7 +63,7 @@ type SignedExtra = ( ); construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Timestamp: pallet_timestamp, diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs index 5f399edda9878..e9ccd5697dfed 100644 --- a/substrate/bin/node-template/runtime/src/lib.rs +++ b/substrate/bin/node-template/runtime/src/lib.rs @@ -258,7 +258,7 @@ impl pallet_template::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Timestamp: pallet_timestamp, Aura: pallet_aura, diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 1043e5017dc36..d7598adb5a22d 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -2083,8 +2083,7 @@ impl pallet_mixnet::Config for Runtime { } construct_runtime!( - pub struct Runtime - { + pub enum Runtime { System: frame_system, Utility: pallet_utility, Babe: pallet_babe, @@ -2099,11 +2098,11 @@ construct_runtime!( AssetConversionTxPayment: pallet_asset_conversion_tx_payment, ElectionProviderMultiPhase: pallet_election_provider_multi_phase, Staking: pallet_staking, - Beefy: pallet_beefy::{Pallet, Call, Storage, Config, ValidateUnsigned}, + Beefy: pallet_beefy, // MMR leaf construction must be before session in order to have leaf contents // refer to block consistently. see substrate issue #11797 for details. - Mmr: pallet_mmr::{Pallet, Storage}, - MmrLeaf: pallet_beefy_mmr::{Pallet, Storage}, + Mmr: pallet_mmr, + MmrLeaf: pallet_beefy_mmr, Session: pallet_session, Democracy: pallet_democracy, Council: pallet_collective::, @@ -2118,7 +2117,7 @@ construct_runtime!( ImOnline: pallet_im_online, AuthorityDiscovery: pallet_authority_discovery, Offences: pallet_offences, - Historical: pallet_session_historical::{Pallet}, + Historical: pallet_session_historical, RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, Identity: pallet_identity, Society: pallet_society, diff --git a/substrate/frame/assets/src/mock.rs b/substrate/frame/assets/src/mock.rs index a4d85b64922f0..d60f535833673 100644 --- a/substrate/frame/assets/src/mock.rs +++ b/substrate/frame/assets/src/mock.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Assets: pallet_assets::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Assets: pallet_assets, } ); diff --git a/substrate/frame/atomic-swap/src/tests.rs b/substrate/frame/atomic-swap/src/tests.rs index 7e2f22b18360e..58502aa4f93c2 100644 --- a/substrate/frame/atomic-swap/src/tests.rs +++ b/substrate/frame/atomic-swap/src/tests.rs @@ -35,9 +35,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - AtomicSwap: pallet_atomic_swap::{Pallet, Call, Event}, + System: frame_system, + Balances: pallet_balances, + AtomicSwap: pallet_atomic_swap, } ); diff --git a/substrate/frame/aura/src/mock.rs b/substrate/frame/aura/src/mock.rs index d38a8583819e3..d87fea8fc81eb 100644 --- a/substrate/frame/aura/src/mock.rs +++ b/substrate/frame/aura/src/mock.rs @@ -35,9 +35,9 @@ const SLOT_DURATION: u64 = 2; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Aura: pallet_aura::{Pallet, Storage, Config}, + System: frame_system, + Timestamp: pallet_timestamp, + Aura: pallet_aura, } ); diff --git a/substrate/frame/authority-discovery/src/lib.rs b/substrate/frame/authority-discovery/src/lib.rs index 3044b41e31de2..640c0c8759ebe 100644 --- a/substrate/frame/authority-discovery/src/lib.rs +++ b/substrate/frame/authority-discovery/src/lib.rs @@ -187,9 +187,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - AuthorityDiscovery: pallet_authority_discovery::{Pallet, Config}, + System: frame_system, + Session: pallet_session, + AuthorityDiscovery: pallet_authority_discovery, } ); diff --git a/substrate/frame/authorship/src/lib.rs b/substrate/frame/authorship/src/lib.rs index 56a516894dec2..8b38a58d8e738 100644 --- a/substrate/frame/authorship/src/lib.rs +++ b/substrate/frame/authorship/src/lib.rs @@ -108,8 +108,8 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Authorship: pallet_authorship::{Pallet, Storage}, + System: frame_system, + Authorship: pallet_authorship, } ); diff --git a/substrate/frame/bags-list/src/mock.rs b/substrate/frame/bags-list/src/mock.rs index 9946a2198ac4f..4282120983b1b 100644 --- a/substrate/frame/bags-list/src/mock.rs +++ b/substrate/frame/bags-list/src/mock.rs @@ -68,10 +68,9 @@ impl bags_list::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Storage, Event, Config}, - BagsList: bags_list::{Pallet, Call, Storage, Event}, + pub enum Runtime { + System: frame_system, + BagsList: bags_list, } ); diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index 8e834483cbe61..708e081fe0bfc 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -75,11 +75,10 @@ impl VariantCount for TestId { } frame_support::construct_runtime!( - pub struct Test - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, + pub enum Test { + System: frame_system, + Balances: pallet_balances, + TransactionPayment: pallet_transaction_payment, } ); diff --git a/substrate/frame/beefy-mmr/src/mock.rs b/substrate/frame/beefy-mmr/src/mock.rs index b85096813deca..94149ac67765d 100644 --- a/substrate/frame/beefy-mmr/src/mock.rs +++ b/substrate/frame/beefy-mmr/src/mock.rs @@ -49,11 +49,11 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Mmr: pallet_mmr::{Pallet, Storage}, - Beefy: pallet_beefy::{Pallet, Config, Storage}, - BeefyMmr: pallet_beefy_mmr::{Pallet, Storage}, + System: frame_system, + Session: pallet_session, + Mmr: pallet_mmr, + Beefy: pallet_beefy, + BeefyMmr: pallet_beefy_mmr, } ); diff --git a/substrate/frame/benchmarking/pov/src/benchmarking.rs b/substrate/frame/benchmarking/pov/src/benchmarking.rs index a24b772ade017..84d81890b1756 100644 --- a/substrate/frame/benchmarking/pov/src/benchmarking.rs +++ b/substrate/frame/benchmarking/pov/src/benchmarking.rs @@ -350,8 +350,8 @@ mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Baseline: crate::{Pallet, Call, Storage, Event}, + System: frame_system, + Baseline: crate, } ); diff --git a/substrate/frame/benchmarking/pov/src/tests.rs b/substrate/frame/benchmarking/pov/src/tests.rs index dda29c071dec7..7fa2fb97dea1b 100644 --- a/substrate/frame/benchmarking/pov/src/tests.rs +++ b/substrate/frame/benchmarking/pov/src/tests.rs @@ -170,8 +170,8 @@ mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Baseline: crate::{Pallet, Call, Storage, Event}, + System: frame_system, + Baseline: crate, } ); diff --git a/substrate/frame/benchmarking/src/baseline.rs b/substrate/frame/benchmarking/src/baseline.rs index 6451284e012b4..2fd3b634ae72d 100644 --- a/substrate/frame/benchmarking/src/baseline.rs +++ b/substrate/frame/benchmarking/src/baseline.rs @@ -121,7 +121,7 @@ pub mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system, } ); diff --git a/substrate/frame/benchmarking/src/tests.rs b/substrate/frame/benchmarking/src/tests.rs index 7d6cfaad609c7..f47a3d9f96a9f 100644 --- a/substrate/frame/benchmarking/src/tests.rs +++ b/substrate/frame/benchmarking/src/tests.rs @@ -70,8 +70,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - TestPallet: pallet_test::{Pallet, Call, Storage}, + System: frame_system, + TestPallet: pallet_test, } ); diff --git a/substrate/frame/benchmarking/src/tests_instance.rs b/substrate/frame/benchmarking/src/tests_instance.rs index 550108408968c..c28aa694a130b 100644 --- a/substrate/frame/benchmarking/src/tests_instance.rs +++ b/substrate/frame/benchmarking/src/tests_instance.rs @@ -80,8 +80,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - TestPallet: pallet_test::{Pallet, Call, Storage, Event}, + System: frame_system, + TestPallet: pallet_test, } ); diff --git a/substrate/frame/bounties/src/tests.rs b/substrate/frame/bounties/src/tests.rs index 22e608cce6373..a7177393a44f1 100644 --- a/substrate/frame/bounties/src/tests.rs +++ b/substrate/frame/bounties/src/tests.rs @@ -44,12 +44,12 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Bounties: pallet_bounties::{Pallet, Call, Storage, Event}, - Bounties1: pallet_bounties::::{Pallet, Call, Storage, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - Treasury1: pallet_treasury::::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Bounties: pallet_bounties, + Bounties1: pallet_bounties::, + Treasury: pallet_treasury, + Treasury1: pallet_treasury::, } ); diff --git a/substrate/frame/child-bounties/src/tests.rs b/substrate/frame/child-bounties/src/tests.rs index 7de45c7312745..e57721adad0ca 100644 --- a/substrate/frame/child-bounties/src/tests.rs +++ b/substrate/frame/child-bounties/src/tests.rs @@ -46,11 +46,11 @@ type BountiesError = pallet_bounties::Error; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Bounties: pallet_bounties::{Pallet, Call, Storage, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - ChildBounties: pallet_child_bounties::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Bounties: pallet_bounties, + Treasury: pallet_treasury, + ChildBounties: pallet_child_bounties, } ); diff --git a/substrate/frame/collective/src/tests.rs b/substrate/frame/collective/src/tests.rs index 06a91cf6fe9c8..dbc3fbe69b3bf 100644 --- a/substrate/frame/collective/src/tests.rs +++ b/substrate/frame/collective/src/tests.rs @@ -38,11 +38,11 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic}, - Collective: pallet_collective::::{Pallet, Call, Event, Origin, Config}, - CollectiveMajority: pallet_collective::::{Pallet, Call, Event, Origin, Config}, - DefaultCollective: pallet_collective::{Pallet, Call, Event, Origin, Config}, - Democracy: mock_democracy::{Pallet, Call, Event}, + System: frame_system, + Collective: pallet_collective::, + CollectiveMajority: pallet_collective::, + DefaultCollective: pallet_collective, + Democracy: mock_democracy, } ); @@ -176,6 +176,7 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig { + system: frame_system::GenesisConfig::default(), collective: pallet_collective::GenesisConfig { members: self.collective_members, phantom: Default::default(), diff --git a/substrate/frame/contracts/mock-network/src/relay_chain.rs b/substrate/frame/contracts/mock-network/src/relay_chain.rs index abe907839d9b9..9671857fb7886 100644 --- a/substrate/frame/contracts/mock-network/src/relay_chain.rs +++ b/substrate/frame/contracts/mock-network/src/relay_chain.rs @@ -233,10 +233,10 @@ impl pallet_message_queue::Config for Runtime { construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, - MessageQueue: pallet_message_queue::{Pallet, Event}, + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + XcmPallet: pallet_xcm, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 28fe3c2af49c7..815395910190c 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -71,13 +71,13 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( 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}, - Randomness: pallet_insecure_randomness_collective_flip::{Pallet, Storage}, - Utility: pallet_utility::{Pallet, Call, Storage, Event}, - Contracts: pallet_contracts::{Pallet, Call, Storage, Event, HoldReason}, - Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Timestamp: pallet_timestamp, + Randomness: pallet_insecure_randomness_collective_flip, + Utility: pallet_utility, + Contracts: pallet_contracts, + Proxy: pallet_proxy, Dummy: pallet_dummy } ); diff --git a/substrate/frame/conviction-voting/src/tests.rs b/substrate/frame/conviction-voting/src/tests.rs index 371d036438437..d7bac505a5420 100644 --- a/substrate/frame/conviction-voting/src/tests.rs +++ b/substrate/frame/conviction-voting/src/tests.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Voting: pallet_conviction_voting::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Voting: pallet_conviction_voting, } ); diff --git a/substrate/frame/core-fellowship/src/tests.rs b/substrate/frame/core-fellowship/src/tests.rs index c9098f2171f40..838bd9bbdc80e 100644 --- a/substrate/frame/core-fellowship/src/tests.rs +++ b/substrate/frame/core-fellowship/src/tests.rs @@ -41,8 +41,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - CoreFellowship: pallet_core_fellowship::{Pallet, Call, Storage, Event}, + System: frame_system, + CoreFellowship: pallet_core_fellowship, } ); diff --git a/substrate/frame/democracy/src/tests.rs b/substrate/frame/democracy/src/tests.rs index 00d8fedca0cfd..888d7e596146f 100644 --- a/substrate/frame/democracy/src/tests.rs +++ b/substrate/frame/democracy/src/tests.rs @@ -55,11 +55,11 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, Preimage: pallet_preimage, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event}, - Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event}, + Scheduler: pallet_scheduler, + Democracy: pallet_democracy, } ); diff --git a/substrate/frame/election-provider-multi-phase/src/mock.rs b/substrate/frame/election-provider-multi-phase/src/mock.rs index e7dd8acf36b1d..507e8f2c39bd9 100644 --- a/substrate/frame/election-provider-multi-phase/src/mock.rs +++ b/substrate/frame/election-provider-multi-phase/src/mock.rs @@ -54,11 +54,10 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event, Config}, - Balances: pallet_balances::{Pallet, Call, Event, Config}, - MultiPhase: multi_phase::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + MultiPhase: multi_phase, } ); diff --git a/substrate/frame/election-provider-support/src/onchain.rs b/substrate/frame/election-provider-support/src/onchain.rs index 412aac4547537..d937f42cb405f 100644 --- a/substrate/frame/election-provider-support/src/onchain.rs +++ b/substrate/frame/election-provider-support/src/onchain.rs @@ -194,9 +194,8 @@ mod tests { pub type Block = sp_runtime::generic::Block; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, } ); diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index 5e50027e34421..2b599ab5292bb 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -1454,9 +1454,9 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Event, Config}, - Elections: elections_phragmen::{Pallet, Call, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Elections: elections_phragmen, } ); @@ -1507,6 +1507,7 @@ mod tests { *m.borrow_mut() = self.genesis_members.iter().map(|(m, _)| *m).collect::>() }); let mut ext: sp_io::TestExternalities = RuntimeGenesisConfig { + system: frame_system::GenesisConfig::default(), balances: pallet_balances::GenesisConfig:: { balances: vec![ (1, 10 * self.balance_factor), diff --git a/substrate/frame/examples/basic/src/tests.rs b/substrate/frame/examples/basic/src/tests.rs index e00b1ac01b39f..2a6fbf0f054ca 100644 --- a/substrate/frame/examples/basic/src/tests.rs +++ b/substrate/frame/examples/basic/src/tests.rs @@ -39,9 +39,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Example: pallet_example_basic::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Example: pallet_example_basic, } ); diff --git a/substrate/frame/examples/default-config/src/lib.rs b/substrate/frame/examples/default-config/src/lib.rs index f1611bca2ce3c..cd1653e6c7643 100644 --- a/substrate/frame/examples/default-config/src/lib.rs +++ b/substrate/frame/examples/default-config/src/lib.rs @@ -143,7 +143,7 @@ pub mod tests { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, DefaultPallet: pallet_default_config_example, } diff --git a/substrate/frame/examples/dev-mode/src/tests.rs b/substrate/frame/examples/dev-mode/src/tests.rs index 3acedcd0fd1d3..c1501a5b4cf76 100644 --- a/substrate/frame/examples/dev-mode/src/tests.rs +++ b/substrate/frame/examples/dev-mode/src/tests.rs @@ -33,9 +33,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Example: pallet_dev_mode::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Example: pallet_dev_mode, } ); diff --git a/substrate/frame/examples/frame-crate/src/lib.rs b/substrate/frame/examples/frame-crate/src/lib.rs index 0fea2c22cf545..7e286df1e32ce 100644 --- a/substrate/frame/examples/frame-crate/src/lib.rs +++ b/substrate/frame/examples/frame-crate/src/lib.rs @@ -49,7 +49,7 @@ mod tests { use frame::testing_prelude::*; construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, MyPallet: my_pallet, } diff --git a/substrate/frame/examples/offchain-worker/src/tests.rs b/substrate/frame/examples/offchain-worker/src/tests.rs index 48a8d86588c2d..ea37a2da493d6 100644 --- a/substrate/frame/examples/offchain-worker/src/tests.rs +++ b/substrate/frame/examples/offchain-worker/src/tests.rs @@ -41,8 +41,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Example: example_offchain_worker::{Pallet, Call, Storage, Event, ValidateUnsigned}, + System: frame_system, + Example: example_offchain_worker, } ); diff --git a/substrate/frame/examples/tasks/src/mock.rs b/substrate/frame/examples/tasks/src/mock.rs index e0fbec3eb7657..5ad104b0dfae4 100644 --- a/substrate/frame/examples/tasks/src/mock.rs +++ b/substrate/frame/examples/tasks/src/mock.rs @@ -26,7 +26,7 @@ pub type Balance = u32; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, TasksExample: tasks_example, } diff --git a/substrate/frame/executive/src/lib.rs b/substrate/frame/executive/src/lib.rs index f2cc3b6316883..cfeb585b0fdcb 100644 --- a/substrate/frame/executive/src/lib.rs +++ b/substrate/frame/executive/src/lib.rs @@ -897,12 +897,11 @@ mod tests { } frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, - Custom: custom::{Pallet, Call, ValidateUnsigned, Inherent}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + TransactionPayment: pallet_transaction_payment, + Custom: custom, } ); diff --git a/substrate/frame/fast-unstake/src/mock.rs b/substrate/frame/fast-unstake/src/mock.rs index f9326919fd3e4..de1772264f162 100644 --- a/substrate/frame/fast-unstake/src/mock.rs +++ b/substrate/frame/fast-unstake/src/mock.rs @@ -181,7 +181,7 @@ impl fast_unstake::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Timestamp: pallet_timestamp, Balances: pallet_balances, diff --git a/substrate/frame/glutton/src/mock.rs b/substrate/frame/glutton/src/mock.rs index 31b78efc57488..26863811e29a7 100644 --- a/substrate/frame/glutton/src/mock.rs +++ b/substrate/frame/glutton/src/mock.rs @@ -33,8 +33,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Glutton: pallet_glutton::{Pallet, Event}, + System: frame_system, + Glutton: pallet_glutton, } ); diff --git a/substrate/frame/identity/src/tests.rs b/substrate/frame/identity/src/tests.rs index e6107cda0f00d..a2b26120254af 100644 --- a/substrate/frame/identity/src/tests.rs +++ b/substrate/frame/identity/src/tests.rs @@ -47,9 +47,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Identity: pallet_identity::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Identity: pallet_identity, } ); diff --git a/substrate/frame/im-online/src/mock.rs b/substrate/frame/im-online/src/mock.rs index 2f4e39220260b..9dad148b10fa1 100644 --- a/substrate/frame/im-online/src/mock.rs +++ b/substrate/frame/im-online/src/mock.rs @@ -42,12 +42,11 @@ use crate::Config; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - ImOnline: imonline::{Pallet, Call, Storage, Config, Event}, - Historical: pallet_session_historical::{Pallet}, + pub enum Runtime { + System: frame_system, + Session: pallet_session, + ImOnline: imonline, + Historical: pallet_session_historical, } ); diff --git a/substrate/frame/indices/src/mock.rs b/substrate/frame/indices/src/mock.rs index 913a37fe55ba8..7ea524a31670a 100644 --- a/substrate/frame/indices/src/mock.rs +++ b/substrate/frame/indices/src/mock.rs @@ -32,9 +32,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Indices: pallet_indices::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Indices: pallet_indices, } ); diff --git a/substrate/frame/insecure-randomness-collective-flip/src/lib.rs b/substrate/frame/insecure-randomness-collective-flip/src/lib.rs index c7ed22d1dd518..00f1055f6f271 100644 --- a/substrate/frame/insecure-randomness-collective-flip/src/lib.rs +++ b/substrate/frame/insecure-randomness-collective-flip/src/lib.rs @@ -179,8 +179,8 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - CollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage}, + System: frame_system, + CollectiveFlip: pallet_insecure_randomness_collective_flip, } ); diff --git a/substrate/frame/lottery/src/mock.rs b/substrate/frame/lottery/src/mock.rs index 6e50529619bfb..884f003aadafe 100644 --- a/substrate/frame/lottery/src/mock.rs +++ b/substrate/frame/lottery/src/mock.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Lottery: pallet_lottery::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Lottery: pallet_lottery, } ); diff --git a/substrate/frame/membership/src/lib.rs b/substrate/frame/membership/src/lib.rs index 2f4bf4bc4ffa1..0e03c097d1233 100644 --- a/substrate/frame/membership/src/lib.rs +++ b/substrate/frame/membership/src/lib.rs @@ -541,8 +541,8 @@ mod tests { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Membership: pallet_membership::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Membership: pallet_membership, } ); diff --git a/substrate/frame/merkle-mountain-range/src/mock.rs b/substrate/frame/merkle-mountain-range/src/mock.rs index d3cb4e5702972..b3b5127db024f 100644 --- a/substrate/frame/merkle-mountain-range/src/mock.rs +++ b/substrate/frame/merkle-mountain-range/src/mock.rs @@ -28,8 +28,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - MMR: pallet_mmr::{Pallet, Storage}, + System: frame_system, + MMR: pallet_mmr, } ); diff --git a/substrate/frame/message-queue/src/integration_test.rs b/substrate/frame/message-queue/src/integration_test.rs index fee5d24213538..aa6f019d650df 100644 --- a/substrate/frame/message-queue/src/integration_test.rs +++ b/substrate/frame/message-queue/src/integration_test.rs @@ -52,8 +52,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, + System: frame_system, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/frame/message-queue/src/mock.rs b/substrate/frame/message-queue/src/mock.rs index 89c6e86251096..f1067ed961e8a 100644 --- a/substrate/frame/message-queue/src/mock.rs +++ b/substrate/frame/message-queue/src/mock.rs @@ -39,8 +39,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event}, + System: frame_system, + MessageQueue: pallet_message_queue, } ); diff --git a/substrate/frame/multisig/src/tests.rs b/substrate/frame/multisig/src/tests.rs index 1798272552910..887c7f8bebc47 100644 --- a/substrate/frame/multisig/src/tests.rs +++ b/substrate/frame/multisig/src/tests.rs @@ -32,9 +32,9 @@ type Block = frame_system::mocking::MockBlockU32; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Multisig: pallet_multisig::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Multisig: pallet_multisig, } ); diff --git a/substrate/frame/nfts/src/mock.rs b/substrate/frame/nfts/src/mock.rs index 4363eccc7ff5a..95443cf41c4e5 100644 --- a/substrate/frame/nfts/src/mock.rs +++ b/substrate/frame/nfts/src/mock.rs @@ -36,9 +36,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Nfts: pallet_nfts::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Nfts: pallet_nfts, } ); diff --git a/substrate/frame/node-authorization/src/mock.rs b/substrate/frame/node-authorization/src/mock.rs index 3c99d41b89ef1..bd648de2b243c 100644 --- a/substrate/frame/node-authorization/src/mock.rs +++ b/substrate/frame/node-authorization/src/mock.rs @@ -36,10 +36,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - NodeAuthorization: pallet_node_authorization::{ - Pallet, Call, Storage, Config, Event, - }, + System: frame_system, + NodeAuthorization: pallet_node_authorization, } ); diff --git a/substrate/frame/nomination-pools/benchmarking/src/mock.rs b/substrate/frame/nomination-pools/benchmarking/src/mock.rs index c58a66f6163af..77124ae388811 100644 --- a/substrate/frame/nomination-pools/benchmarking/src/mock.rs +++ b/substrate/frame/nomination-pools/benchmarking/src/mock.rs @@ -180,14 +180,13 @@ impl crate::Config for Runtime {} type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - VoterList: pallet_bags_list::::{Pallet, Call, Storage, Event}, - Pools: pallet_nomination_pools::{Pallet, Call, Storage, Event, FreezeReason}, + pub enum Runtime { + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Staking: pallet_staking, + VoterList: pallet_bags_list::, + Pools: pallet_nomination_pools, } ); diff --git a/substrate/frame/nomination-pools/src/mock.rs b/substrate/frame/nomination-pools/src/mock.rs index 1bd969230da93..cd91fbb33c1dc 100644 --- a/substrate/frame/nomination-pools/src/mock.rs +++ b/substrate/frame/nomination-pools/src/mock.rs @@ -295,11 +295,10 @@ impl pools::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Storage, Event, Config}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Pools: pools::{Pallet, Call, Storage, Event, FreezeReason}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + Pools: pools, } ); diff --git a/substrate/frame/nomination-pools/test-staking/src/mock.rs b/substrate/frame/nomination-pools/test-staking/src/mock.rs index 491cd61916198..cbd7a4d07589a 100644 --- a/substrate/frame/nomination-pools/test-staking/src/mock.rs +++ b/substrate/frame/nomination-pools/test-staking/src/mock.rs @@ -192,14 +192,13 @@ impl pallet_nomination_pools::Config for Runtime { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - VoterList: pallet_bags_list::::{Pallet, Call, Storage, Event}, - Pools: pallet_nomination_pools::{Pallet, Call, Storage, Event, FreezeReason}, + pub enum Runtime { + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Staking: pallet_staking, + VoterList: pallet_bags_list::, + Pools: pallet_nomination_pools, } ); diff --git a/substrate/frame/offences/benchmarking/src/mock.rs b/substrate/frame/offences/benchmarking/src/mock.rs index 1d642b9b4982a..38c6fb6ea5f6e 100644 --- a/substrate/frame/offences/benchmarking/src/mock.rs +++ b/substrate/frame/offences/benchmarking/src/mock.rs @@ -227,9 +227,9 @@ frame_support::construct_runtime!( pub enum Test { System: system::{Pallet, Call, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, + Balances: pallet_balances, + Staking: pallet_staking, + Session: pallet_session, ImOnline: pallet_im_online::{Pallet, Call, Storage, Event, ValidateUnsigned, Config}, Offences: pallet_offences::{Pallet, Storage, Event}, Historical: pallet_session_historical::{Pallet}, diff --git a/substrate/frame/offences/src/mock.rs b/substrate/frame/offences/src/mock.rs index 61f680f6db928..d97be99def1cc 100644 --- a/substrate/frame/offences/src/mock.rs +++ b/substrate/frame/offences/src/mock.rs @@ -68,10 +68,9 @@ pub fn with_on_offence_fractions) -> R>(f: F) -> type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Offences: offences::{Pallet, Storage, Event}, + pub enum Runtime { + System: frame_system, + Offences: offences, } ); diff --git a/substrate/frame/proxy/src/tests.rs b/substrate/frame/proxy/src/tests.rs index 89bd8b68f0918..67a662e01b2bf 100644 --- a/substrate/frame/proxy/src/tests.rs +++ b/substrate/frame/proxy/src/tests.rs @@ -35,10 +35,10 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Proxy: proxy::{Pallet, Call, Storage, Event}, - Utility: pallet_utility::{Pallet, Call, Event}, + System: frame_system, + Balances: pallet_balances, + Proxy: proxy, + Utility: pallet_utility, } ); diff --git a/substrate/frame/ranked-collective/src/tests.rs b/substrate/frame/ranked-collective/src/tests.rs index 60c0da3d7ac29..b3605169339af 100644 --- a/substrate/frame/ranked-collective/src/tests.rs +++ b/substrate/frame/ranked-collective/src/tests.rs @@ -37,8 +37,8 @@ type Class = Rank; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Club: pallet_ranked_collective::{Pallet, Call, Storage, Event}, + System: frame_system, + Club: pallet_ranked_collective, } ); diff --git a/substrate/frame/recovery/src/mock.rs b/substrate/frame/recovery/src/mock.rs index 44cbeec09862d..9adb2b80931a8 100644 --- a/substrate/frame/recovery/src/mock.rs +++ b/substrate/frame/recovery/src/mock.rs @@ -35,9 +35,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Recovery: recovery::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Recovery: recovery, } ); diff --git a/substrate/frame/remark/src/mock.rs b/substrate/frame/remark/src/mock.rs index 0a385c30eac30..5a5e6a3ccdff2 100644 --- a/substrate/frame/remark/src/mock.rs +++ b/substrate/frame/remark/src/mock.rs @@ -34,8 +34,8 @@ pub type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Remark: pallet_remark::{ Pallet, Call, Event }, + System: frame_system, + Remark: pallet_remark, } ); diff --git a/substrate/frame/root-offences/src/mock.rs b/substrate/frame/root-offences/src/mock.rs index c0c83dd08d243..583ba5b92fb0f 100644 --- a/substrate/frame/root-offences/src/mock.rs +++ b/substrate/frame/root-offences/src/mock.rs @@ -48,13 +48,13 @@ pub const BLOCK_TIME: u64 = 1000; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - RootOffences: root_offences::{Pallet, Call, Storage, Event}, - Historical: pallet_session::historical::{Pallet, Storage}, + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + Staking: pallet_staking, + Session: pallet_session, + RootOffences: root_offences, + Historical: pallet_session::historical, } ); diff --git a/substrate/frame/salary/src/tests.rs b/substrate/frame/salary/src/tests.rs index fbca1be11883f..f25acd9345284 100644 --- a/substrate/frame/salary/src/tests.rs +++ b/substrate/frame/salary/src/tests.rs @@ -40,8 +40,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Salary: pallet_salary::{Pallet, Call, Storage, Event}, + System: frame_system, + Salary: pallet_salary, } ); diff --git a/substrate/frame/scheduler/src/mock.rs b/substrate/frame/scheduler/src/mock.rs index 4edcfa0a7bfd8..d22b9fcf8d99e 100644 --- a/substrate/frame/scheduler/src/mock.rs +++ b/substrate/frame/scheduler/src/mock.rs @@ -97,10 +97,10 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Logger: logger::{Pallet, Call, Event}, - Scheduler: scheduler::{Pallet, Call, Storage, Event}, - Preimage: pallet_preimage::{Pallet, Call, Storage, Event, HoldReason}, + System: frame_system, + Logger: logger, + Scheduler: scheduler, + Preimage: pallet_preimage, } ); diff --git a/substrate/frame/scored-pool/src/mock.rs b/substrate/frame/scored-pool/src/mock.rs index 6c032ab808cca..00818f4aad066 100644 --- a/substrate/frame/scored-pool/src/mock.rs +++ b/substrate/frame/scored-pool/src/mock.rs @@ -37,9 +37,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ScoredPool: pallet_scored_pool::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + ScoredPool: pallet_scored_pool, } ); diff --git a/substrate/frame/session/benchmarking/src/mock.rs b/substrate/frame/session/benchmarking/src/mock.rs index e1744fa43abbb..c305641e185c6 100644 --- a/substrate/frame/session/benchmarking/src/mock.rs +++ b/substrate/frame/session/benchmarking/src/mock.rs @@ -38,10 +38,10 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Staking: pallet_staking::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Staking: pallet_staking, + Session: pallet_session, } ); diff --git a/substrate/frame/session/src/mock.rs b/substrate/frame/session/src/mock.rs index f3f18fde168c4..eb9eddfd847e6 100644 --- a/substrate/frame/session/src/mock.rs +++ b/substrate/frame/session/src/mock.rs @@ -82,9 +82,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, - Historical: pallet_session_historical::{Pallet}, + System: frame_system, + Session: pallet_session, + Historical: pallet_session_historical, } ); @@ -92,8 +92,8 @@ frame_support::construct_runtime!( frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Session: pallet_session::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Session: pallet_session, } ); diff --git a/substrate/frame/society/src/mock.rs b/substrate/frame/society/src/mock.rs index 3e29d01ca8e36..749d196b6e1b5 100644 --- a/substrate/frame/society/src/mock.rs +++ b/substrate/frame/society/src/mock.rs @@ -39,9 +39,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Society: pallet_society::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Society: pallet_society, } ); diff --git a/substrate/frame/state-trie-migration/src/lib.rs b/substrate/frame/state-trie-migration/src/lib.rs index ea28d71260575..c71002f420ce4 100644 --- a/substrate/frame/state-trie-migration/src/lib.rs +++ b/substrate/frame/state-trie-migration/src/lib.rs @@ -1071,9 +1071,9 @@ mod mock { frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Config, Storage, Event}, - StateTrieMigration: pallet_state_trie_migration::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + StateTrieMigration: pallet_state_trie_migration, } ); diff --git a/substrate/frame/sudo/src/mock.rs b/substrate/frame/sudo/src/mock.rs index 878e923908099..9ad14804524a9 100644 --- a/substrate/frame/sudo/src/mock.rs +++ b/substrate/frame/sudo/src/mock.rs @@ -98,9 +98,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Sudo: sudo::{Pallet, Call, Config, Storage, Event}, - Logger: logger::{Pallet, Call, Storage, Event}, + System: frame_system, + Sudo: sudo, + Logger: logger, } ); diff --git a/substrate/frame/support/procedural/src/construct_runtime/mod.rs b/substrate/frame/support/procedural/src/construct_runtime/mod.rs index 7a9c4d89a7494..54ed15f7b1d36 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/mod.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/mod.rs @@ -21,7 +21,7 @@ //! order to get all the pallet parts for each pallet. //! //! Pallets can define their parts: -//! - Implicitely: `System: frame_system` +//! - Implicitly: `System: frame_system` //! - Explicitly: `System: frame_system::{Pallet, Call}` //! //! The `construct_runtime` transitions from the implicit definition to the explict one. @@ -172,7 +172,7 @@ //! //! This call has no implicit pallet parts, thus it will expand to the runtime construction: //! ```ignore -//! pub struct Runtime { ... } +//! pub enum Runtime { ... } //! pub struct Call { ... } //! impl Call ... //! pub enum Origin { ... } @@ -342,7 +342,7 @@ fn construct_runtime_final_expansion( syn::Error::new( pallets_token.span.join(), "`System` pallet declaration is missing. \ - Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event},`", + Please add this line: `System: frame_system,`", ) })?; if !system_pallet.cfg_pattern.is_empty() { diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index af1f99be1031b..95478d1a8cca7 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -2291,7 +2291,7 @@ pub mod pallet_macros { /// # type Block = frame_system::mocking::MockBlock; /// # } /// construct_runtime! { - /// pub struct Runtime { + /// pub enum Runtime { /// System: frame_system, /// Custom: custom_pallet /// } diff --git a/substrate/frame/support/src/migrations.rs b/substrate/frame/support/src/migrations.rs index bfd62c8611c60..d059a992a8664 100644 --- a/substrate/frame/support/src/migrations.rs +++ b/substrate/frame/support/src/migrations.rs @@ -254,10 +254,10 @@ pub fn migrate_from_pallet_version_to_storage_version< /// construct_runtime! { /// pub enum Runtime /// { -/// System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, +/// System: frame_system = 0, /// -/// SomePalletToRemove: pallet_something::{Pallet, Call, Storage, Event} = 1, -/// AnotherPalletToRemove: pallet_something_else::{Pallet, Call, Storage, Event} = 2, +/// SomePalletToRemove: pallet_something = 1, +/// AnotherPalletToRemove: pallet_something_else = 2, /// /// YourOtherPallets... /// } diff --git a/substrate/frame/support/test/compile_pass/src/lib.rs b/substrate/frame/support/test/compile_pass/src/lib.rs index b304dfcb2823e..575322df7604f 100644 --- a/substrate/frame/support/test/compile_pass/src/lib.rs +++ b/substrate/frame/support/test/compile_pass/src/lib.rs @@ -83,7 +83,7 @@ pub type Block = generic::Block; pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: renamed_frame_system, } ); diff --git a/substrate/frame/support/test/stg_frame_crate/src/lib.rs b/substrate/frame/support/test/stg_frame_crate/src/lib.rs index 501fcf6a70d7a..59a66851f237c 100644 --- a/substrate/frame/support/test/stg_frame_crate/src/lib.rs +++ b/substrate/frame/support/test/stg_frame_crate/src/lib.rs @@ -68,8 +68,8 @@ mod tests { construct_runtime! { pub struct Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Pallet: pallet::{Pallet, Config}, + System: frame_system, + Pallet: pallet, } } } diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr index 11ec6f33d2043..0f74553f7ecc3 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr +++ b/substrate/frame/support/test/tests/construct_runtime_ui/missing_system_module.stderr @@ -1,4 +1,4 @@ -error: `System` pallet declaration is missing. Please add this line: `System: frame_system::{Pallet, Call, Storage, Config, Event},` +error: `System` pallet declaration is missing. Please add this line: `System: frame_system,` --> tests/construct_runtime_ui/missing_system_module.rs:22:2 | 22 | / { diff --git a/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs b/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs index ad63708747694..5cde4a9bebab3 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui/pass/composite_enum_instance.rs @@ -64,7 +64,7 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; frame_support::construct_runtime!( - pub struct Runtime + pub enum Runtime { // Exclude part `Storage` in order not to check its metadata in tests. System: frame_system, diff --git a/substrate/frame/support/test/tests/final_keys.rs b/substrate/frame/support/test/tests/final_keys.rs index 765afaf1e6604..38240830daa2b 100644 --- a/substrate/frame/support/test/tests/final_keys.rs +++ b/substrate/frame/support/test/tests/final_keys.rs @@ -201,7 +201,6 @@ pub type Block = generic::Block; frame_support::construct_runtime!( pub enum Runtime - { System: frame_system, FinalKeysNone: no_instance, diff --git a/substrate/frame/support/test/tests/instance.rs b/substrate/frame/support/test/tests/instance.rs index 43a93df9dea49..7a888e5685d11 100644 --- a/substrate/frame/support/test/tests/instance.rs +++ b/substrate/frame/support/test/tests/instance.rs @@ -278,24 +278,14 @@ pub type Block = generic::Block; frame_support::construct_runtime!( pub enum Runtime { - System: frame_system::{Pallet, Call, Event}, - Module1_1: module1::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module1_2: module1::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module2: module2::{Pallet, Call, Storage, Event, Config, Origin, Inherent}, - Module2_1: module2::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module2_2: module2::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module2_3: module2::::{ - Pallet, Call, Storage, Event, Config, Origin, Inherent - }, - Module3: module3::{Pallet, Call}, + System: frame_system, + Module1_1: module1::, + Module1_2: module1::, + Module2: module2, + Module2_1: module2::, + Module2_2: module2::, + Module2_3: module2::, + Module3: module3, } ); @@ -350,6 +340,7 @@ impl module3::Config for Runtime { fn new_test_ext() -> sp_io::TestExternalities { RuntimeGenesisConfig { + system: Default::default(), module_1_1: module1::GenesisConfig { value: 3, test: 2 }, module_1_2: module1::GenesisConfig { value: 4, test: 5 }, module_2: module2::GenesisConfig { diff --git a/substrate/frame/support/test/tests/issue2219.rs b/substrate/frame/support/test/tests/issue2219.rs index 4016707b51a8d..4c384f4327623 100644 --- a/substrate/frame/support/test/tests/issue2219.rs +++ b/substrate/frame/support/test/tests/issue2219.rs @@ -176,7 +176,7 @@ impl frame_system::Config for Runtime { impl module::Config for Runtime {} frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, Module: module, } diff --git a/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs b/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs index de856ddcd3e92..7e67193cc76c5 100644 --- a/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs +++ b/substrate/frame/support/test/tests/pallet_ui/pass/no_std_genesis_config.rs @@ -57,8 +57,8 @@ impl frame_system::Config for Runtime { construct_runtime! { pub struct Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Pallet: test_pallet::{Pallet, Config}, + System: frame_system, + Pallet: test_pallet, } } diff --git a/substrate/frame/support/test/tests/storage_layers.rs b/substrate/frame/support/test/tests/storage_layers.rs index a6d16e0d66d93..88edd7de6ca23 100644 --- a/substrate/frame/support/test/tests/storage_layers.rs +++ b/substrate/frame/support/test/tests/storage_layers.rs @@ -94,7 +94,7 @@ impl frame_system::Config for Runtime { impl Config for Runtime {} frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: frame_system, MyPallet: pallet, } diff --git a/substrate/frame/support/test/tests/versioned_migration.rs b/substrate/frame/support/test/tests/versioned_migration.rs index 03dbd948df92a..dab5e06dc858f 100644 --- a/substrate/frame/support/test/tests/versioned_migration.rs +++ b/substrate/frame/support/test/tests/versioned_migration.rs @@ -66,8 +66,8 @@ impl dummy_pallet::Config for Test {} construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, - DummyPallet: dummy_pallet::{Pallet, Config, Storage} = 1, + System: frame_system = 0, + DummyPallet: dummy_pallet = 1, } ); diff --git a/substrate/frame/system/benches/bench.rs b/substrate/frame/system/benches/bench.rs index 79d5a2d868901..a0c567bf85273 100644 --- a/substrate/frame/system/benches/bench.rs +++ b/substrate/frame/system/benches/bench.rs @@ -47,10 +47,9 @@ mod module { type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub struct Runtime - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Module: module::{Pallet, Event}, + pub enum Runtime { + System: frame_system, + Module: module, } ); diff --git a/substrate/frame/system/benchmarking/src/mock.rs b/substrate/frame/system/benchmarking/src/mock.rs index 9a81cddca142d..edbf74a9a51ac 100644 --- a/substrate/frame/system/benchmarking/src/mock.rs +++ b/substrate/frame/system/benchmarking/src/mock.rs @@ -31,7 +31,7 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system, } ); diff --git a/substrate/frame/system/src/mock.rs b/substrate/frame/system/src/mock.rs index e33ac2f56c875..06527a9bb2912 100644 --- a/substrate/frame/system/src/mock.rs +++ b/substrate/frame/system/src/mock.rs @@ -31,7 +31,7 @@ type Block = mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system, } ); diff --git a/substrate/frame/timestamp/src/mock.rs b/substrate/frame/timestamp/src/mock.rs index b75bcaeb0e037..5cbc5211368d4 100644 --- a/substrate/frame/timestamp/src/mock.rs +++ b/substrate/frame/timestamp/src/mock.rs @@ -37,8 +37,8 @@ type Moment = u64; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + System: frame_system, + Timestamp: pallet_timestamp, } ); diff --git a/substrate/frame/tips/src/tests.rs b/substrate/frame/tips/src/tests.rs index 63ac8e37cddda..b8e528bbe7ab4 100644 --- a/substrate/frame/tips/src/tests.rs +++ b/substrate/frame/tips/src/tests.rs @@ -44,12 +44,12 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - Treasury1: pallet_treasury::::{Pallet, Call, Storage, Config, Event}, - Tips: pallet_tips::{Pallet, Call, Storage, Event}, - Tips1: pallet_tips::::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Treasury: pallet_treasury, + Treasury1: pallet_treasury::, + Tips: pallet_tips, + Tips1: pallet_tips::, } ); diff --git a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs index c9b00be8e2ce5..03142d6ae3766 100644 --- a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs @@ -37,7 +37,7 @@ type Balance = u64; type AccountId = u64; frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: system, Balances: pallet_balances, TransactionPayment: pallet_transaction_payment, diff --git a/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs b/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs index 5c540c3e45955..17c4c773997eb 100644 --- a/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/skip-feeless-payment/src/mock.rs @@ -84,7 +84,7 @@ pub mod pallet_dummy { impl pallet_dummy::Config for Runtime {} frame_support::construct_runtime!( - pub struct Runtime { + pub enum Runtime { System: system, SkipFeeless: pallet_skip_feeless_payment, DummyPallet: pallet_dummy, diff --git a/substrate/frame/transaction-payment/src/mock.rs b/substrate/frame/transaction-payment/src/mock.rs index d6686d44c8019..2f025ae81d256 100644 --- a/substrate/frame/transaction-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/src/mock.rs @@ -36,8 +36,8 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub struct Runtime { - System: system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + System: system, + Balances: pallet_balances, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, } ); diff --git a/substrate/frame/transaction-storage/src/mock.rs b/substrate/frame/transaction-storage/src/mock.rs index a8da19a382df1..4b2fe5a2a8ca3 100644 --- a/substrate/frame/transaction-storage/src/mock.rs +++ b/substrate/frame/transaction-storage/src/mock.rs @@ -33,11 +33,9 @@ pub type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Config, Storage, Event}, - TransactionStorage: pallet_transaction_storage::{ - Pallet, Call, Storage, Config, Inherent, Event, HoldReason - }, + System: frame_system, + Balances: pallet_balances, + TransactionStorage: pallet_transaction_storage, } ); diff --git a/substrate/frame/treasury/src/tests.rs b/substrate/frame/treasury/src/tests.rs index 093757b277019..602159262e465 100644 --- a/substrate/frame/treasury/src/tests.rs +++ b/substrate/frame/treasury/src/tests.rs @@ -47,9 +47,9 @@ type TreasuryCall = crate::Call; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Treasury: treasury::{Pallet, Call, Storage, Config, Event}, + System: frame_system, + Balances: pallet_balances, + Treasury: treasury, Utility: pallet_utility, } ); diff --git a/substrate/frame/uniques/src/mock.rs b/substrate/frame/uniques/src/mock.rs index 056c19ec55934..9120108e0d432 100644 --- a/substrate/frame/uniques/src/mock.rs +++ b/substrate/frame/uniques/src/mock.rs @@ -35,9 +35,9 @@ type Block = frame_system::mocking::MockBlock; construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Uniques: pallet_uniques::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Uniques: pallet_uniques, } ); diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index 7b42fa511d100..cfdbd6faf0dc4 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -129,14 +129,14 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Timestamp: pallet_timestamp::{Call, Inherent}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - RootTesting: pallet_root_testing::{Pallet, Call, Storage, Event}, + System: frame_system, + Timestamp: pallet_timestamp, + Balances: pallet_balances, + RootTesting: pallet_root_testing, Council: pallet_collective::, - Utility: utility::{Pallet, Call, Event}, - Example: example::{Pallet, Call}, - Democracy: mock_democracy::{Pallet, Call, Event}, + Utility: utility, + Example: example, + Democracy: mock_democracy, } ); diff --git a/substrate/frame/vesting/src/mock.rs b/substrate/frame/vesting/src/mock.rs index 3af4a9c962d1b..420edd5e17a2c 100644 --- a/substrate/frame/vesting/src/mock.rs +++ b/substrate/frame/vesting/src/mock.rs @@ -33,9 +33,9 @@ type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config}, + System: frame_system, + Balances: pallet_balances, + Vesting: pallet_vesting, } ); diff --git a/substrate/primitives/api/src/lib.rs b/substrate/primitives/api/src/lib.rs index 1b8b7c40ae074..0a9b334a96f8e 100644 --- a/substrate/primitives/api/src/lib.rs +++ b/substrate/primitives/api/src/lib.rs @@ -282,7 +282,7 @@ pub use sp_api_proc_macro::decl_runtime_apis; /// # /// # /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro /// # /// in a real runtime. -/// # pub struct Runtime {} +/// # pub enum Runtime {} /// # /// # sp_api::decl_runtime_apis! { /// # /// Declare the api trait. @@ -361,7 +361,7 @@ pub use sp_api_proc_macro::decl_runtime_apis; /// let's say you want to implement a staging version of the runtime api and put it behind a /// feature flag. You can do it this way: /// ```ignore -/// pub struct Runtime {} +/// pub enum Runtime {} /// sp_api::decl_runtime_apis! { /// pub trait ApiWithStagingMethod { /// fn stable_one(data: u64); diff --git a/substrate/primitives/api/test/tests/decl_and_impl.rs b/substrate/primitives/api/test/tests/decl_and_impl.rs index 6e895680e41c4..d68470551d200 100644 --- a/substrate/primitives/api/test/tests/decl_and_impl.rs +++ b/substrate/primitives/api/test/tests/decl_and_impl.rs @@ -24,7 +24,7 @@ use substrate_test_runtime_client::runtime::{Block, Hash}; /// The declaration of the `Runtime` type is done by the `construct_runtime!` macro in a real /// runtime. -pub struct Runtime {} +pub enum Runtime {} decl_runtime_apis! { pub trait Api { diff --git a/substrate/utils/frame/rpc/support/src/lib.rs b/substrate/utils/frame/rpc/support/src/lib.rs index bb5098293c285..e3ccbd6965893 100644 --- a/substrate/utils/frame/rpc/support/src/lib.rs +++ b/substrate/utils/frame/rpc/support/src/lib.rs @@ -42,8 +42,8 @@ use sp_storage::{StorageData, StorageKey}; /// # construct_runtime!( /// # pub enum TestRuntime /// # { -/// # System: frame_system::{Pallet, Call, Config, Storage, Event}, -/// # Test: pallet_test::{Pallet, Storage}, +/// # System: frame_system, +/// # Test: pallet_test, /// # } /// # ); /// #