diff --git a/Cargo.lock b/Cargo.lock index e3d65f292221..b3db7a17f496 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5304,7 +5304,6 @@ dependencies = [ "futures 0.3.5", "futures-timer 2.0.2", "log 0.4.8", - "pallet-babe", "parity-scale-codec", "parking_lot 0.9.0", "polkadot-availability-store", @@ -6032,7 +6031,6 @@ dependencies = [ "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", - "pallet-society", "pallet-staking", "pallet-staking-reward-curve", "pallet-sudo", diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 0c32e5a97199..48b3ceba36f8 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -45,14 +45,14 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } codec = { package = "parity-scale-codec", version = "1.3.4" } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/service/src/chain_spec.rs b/node/service/src/chain_spec.rs index 401337c218af..b90207c53b7b 100644 --- a/node/service/src/chain_spec.rs +++ b/node/service/src/chain_spec.rs @@ -31,7 +31,7 @@ use telemetry::TelemetryEndpoints; use hex_literal::hex; use babe_primitives::AuthorityId as BabeId; use grandpa::AuthorityId as GrandpaId; -use im_online::sr25519::{AuthorityId as ImOnlineId}; +use pallet_im_online::sr25519::{AuthorityId as ImOnlineId}; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_staking::Forcing; @@ -131,27 +131,27 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene const STASH: u128 = 100 * DOTS; polkadot::GenesisConfig { - system: Some(polkadot::SystemConfig { + frame_system: Some(polkadot::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(polkadot::BalancesConfig { + pallet_balances: Some(polkadot::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(polkadot::IndicesConfig { + pallet_indices: Some(polkadot::IndicesConfig { indices: vec![], }), - session: Some(polkadot::SessionConfig { + pallet_session: Some(polkadot::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), polkadot_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(polkadot::StakingConfig { + pallet_staking: Some(polkadot::StakingConfig { validator_count: 50, minimum_validator_count: 4, stakers: initial_authorities @@ -163,21 +163,21 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(Default::default()), - collective_Instance1: Some(polkadot::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(Default::default()), + pallet_collective_Instance1: Some(polkadot::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(polkadot::ParachainsConfig { @@ -191,7 +191,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene claims: vec![], vesting: vec![], }), - vesting: Some(polkadot::VestingConfig { + pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![], }), } @@ -283,27 +283,27 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi const STASH: u128 = 100 * WND; westend::GenesisConfig { - system: Some(westend::SystemConfig { + frame_system: Some(westend::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(westend::BalancesConfig { + pallet_balances: Some(westend::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(westend::IndicesConfig { + pallet_indices: Some(westend::IndicesConfig { indices: vec![], }), - session: Some(westend::SessionConfig { + pallet_session: Some(westend::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), westend_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(westend::StakingConfig { + pallet_staking: Some(westend::StakingConfig { validator_count: 50, minimum_validator_count: 4, stakers: initial_authorities @@ -315,10 +315,10 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(westend::AuthorityDiscoveryConfig { + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(westend::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(westend::ParachainsConfig { @@ -328,10 +328,10 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi parachains: vec![], _phdata: Default::default(), }), - vesting: Some(westend::VestingConfig { + pallet_vesting: Some(westend::VestingConfig { vesting: vec![], }), - sudo: Some(westend::SudoConfig { + pallet_sudo: Some(westend::SudoConfig { key: endowed_accounts[0].clone(), }), } @@ -423,27 +423,27 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC const STASH: u128 = 100 * KSM; kusama::GenesisConfig { - system: Some(kusama::SystemConfig { + frame_system: Some(kusama::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(kusama::BalancesConfig { + pallet_balances: Some(kusama::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(kusama::IndicesConfig { + pallet_indices: Some(kusama::IndicesConfig { indices: vec![], }), - session: Some(kusama::SessionConfig { + pallet_session: Some(kusama::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), kusama_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(kusama::StakingConfig { + pallet_staking: Some(kusama::StakingConfig { validator_count: 50, minimum_validator_count: 4, stakers: initial_authorities @@ -455,21 +455,21 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(Default::default()), - collective_Instance1: Some(kusama::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(Default::default()), + pallet_collective_Instance1: Some(kusama::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(kusama::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(kusama::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(kusama::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(kusama::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(kusama::ParachainsConfig { @@ -483,7 +483,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC claims: vec![], vesting: vec![], }), - vesting: Some(kusama::VestingConfig { + pallet_vesting: Some(kusama::VestingConfig { vesting: vec![], }), } @@ -612,24 +612,24 @@ pub fn polkadot_testnet_genesis( const STASH: u128 = 100 * DOTS; polkadot::GenesisConfig { - system: Some(polkadot::SystemConfig { + frame_system: Some(polkadot::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(polkadot::IndicesConfig { + pallet_indices: Some(polkadot::IndicesConfig { indices: vec![], }), - balances: Some(polkadot::BalancesConfig { + pallet_balances: Some(polkadot::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(polkadot::SessionConfig { + pallet_session: Some(polkadot::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), polkadot_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(polkadot::StakingConfig { + pallet_staking: Some(polkadot::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities.iter() @@ -640,21 +640,21 @@ pub fn polkadot_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(polkadot::DemocracyConfig::default()), - collective_Instance1: Some(polkadot::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(polkadot::DemocracyConfig::default()), + pallet_collective_Instance1: Some(polkadot::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(polkadot::ParachainsConfig { @@ -668,7 +668,7 @@ pub fn polkadot_testnet_genesis( claims: vec![], vesting: vec![], }), - vesting: Some(polkadot::VestingConfig { + pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![], }), } @@ -687,24 +687,24 @@ pub fn kusama_testnet_genesis( const STASH: u128 = 100 * KSM; kusama::GenesisConfig { - system: Some(kusama::SystemConfig { + frame_system: Some(kusama::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(kusama::IndicesConfig { + pallet_indices: Some(kusama::IndicesConfig { indices: vec![], }), - balances: Some(kusama::BalancesConfig { + pallet_balances: Some(kusama::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(kusama::SessionConfig { + pallet_session: Some(kusama::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), kusama_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(kusama::StakingConfig { + pallet_staking: Some(kusama::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities.iter() @@ -715,21 +715,21 @@ pub fn kusama_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(kusama::DemocracyConfig::default()), - collective_Instance1: Some(kusama::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(kusama::DemocracyConfig::default()), + pallet_collective_Instance1: Some(kusama::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(kusama::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(kusama::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(kusama::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(kusama::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(kusama::ParachainsConfig { @@ -743,7 +743,7 @@ pub fn kusama_testnet_genesis( claims: vec![], vesting: vec![], }), - vesting: Some(kusama::VestingConfig { + pallet_vesting: Some(kusama::VestingConfig { vesting: vec![], }), } @@ -762,24 +762,24 @@ pub fn westend_testnet_genesis( const STASH: u128 = 100 * DOTS; westend::GenesisConfig { - system: Some(westend::SystemConfig { + frame_system: Some(westend::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(westend::IndicesConfig { + pallet_indices: Some(westend::IndicesConfig { indices: vec![], }), - balances: Some(westend::BalancesConfig { + pallet_balances: Some(westend::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(westend::SessionConfig { + pallet_session: Some(westend::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), westend_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(westend::StakingConfig { + pallet_staking: Some(westend::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities.iter() @@ -790,10 +790,10 @@ pub fn westend_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(westend::AuthorityDiscoveryConfig { + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(westend::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(westend::ParachainsConfig { @@ -803,10 +803,10 @@ pub fn westend_testnet_genesis( parachains: vec![], _phdata: Default::default(), }), - vesting: Some(westend::VestingConfig { + pallet_vesting: Some(westend::VestingConfig { vesting: vec![], }), - sudo: Some(westend::SudoConfig { + pallet_sudo: Some(westend::SudoConfig { key: root_key, }), } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index e7e75369fcc3..c347c94ec041 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -84,7 +84,7 @@ pub trait RuntimeApiCollection: + babe_primitives::BabeApi + grandpa_primitives::GrandpaApi + sp_block_builder::BlockBuilder - + system_rpc_runtime_api::AccountNonceApi + + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi @@ -102,7 +102,7 @@ where + babe_primitives::BabeApi + grandpa_primitives::GrandpaApi + sp_block_builder::BlockBuilder - + system_rpc_runtime_api::AccountNonceApi + + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi diff --git a/node/test-service/src/chain_spec.rs b/node/test-service/src/chain_spec.rs index 67d1667469b8..45d9da8f9a8f 100644 --- a/node/test-service/src/chain_spec.rs +++ b/node/test-service/src/chain_spec.rs @@ -106,18 +106,18 @@ fn polkadot_testnet_genesis( const STASH: u128 = 100 * DOTS; polkadot::GenesisConfig { - system: Some(polkadot::SystemConfig { + frame_system: Some(polkadot::SystemConfig { code: polkadot::WASM_BINARY.expect("Wasm binary must be built for testing").to_vec(), changes_trie_config, }), - indices: Some(polkadot::IndicesConfig { indices: vec![] }), - balances: Some(polkadot::BalancesConfig { + pallet_indices: Some(polkadot::IndicesConfig { indices: vec![] }), + pallet_balances: Some(polkadot::BalancesConfig { balances: endowed_accounts .iter() .map(|k| (k.clone(), ENDOWMENT)) .collect(), }), - session: Some(polkadot::SessionConfig { + pallet_session: Some(polkadot::SessionConfig { keys: initial_authorities .iter() .map(|x| { @@ -133,7 +133,7 @@ fn polkadot_testnet_genesis( }) .collect::>(), }), - staking: Some(polkadot::StakingConfig { + pallet_staking: Some(polkadot::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities @@ -152,9 +152,9 @@ fn polkadot_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), ..Default::default() }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { keys: vec![] }), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { keys: vec![] }), parachains: Some(polkadot::ParachainsConfig { authorities: vec![], }), @@ -166,8 +166,8 @@ fn polkadot_testnet_genesis( claims: vec![], vesting: vec![], }), - vesting: Some(polkadot::VestingConfig { vesting: vec![] }), - sudo: Some(polkadot::SudoConfig { key: root_key }), + pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![] }), + pallet_sudo: Some(polkadot::SudoConfig { key: root_key }), } } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 72694c33b9e2..3d3b0e44b071 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -22,16 +22,16 @@ sp-session = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } @@ -42,11 +42,11 @@ runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parac hex-literal = "0.2.1" keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" } -treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master" } trie-db = "0.22.0" serde_json = "1.0.41" libsecp256k1 = "0.3.2" @@ -68,21 +68,21 @@ std = [ "sp-std/std", "sp-io/std", "frame-support/std", - "authorship/std", - "balances/std", + "pallet-authorship/std", + "pallet-balances/std", "sp-runtime/std", "sp-session/std", "sp-staking/std", - "session/std", - "staking/std", - "system/std", - "timestamp/std", - "vesting/std", - "transaction-payment/std", + "pallet-session/std", + "pallet-staking/std", + "frame-system/std", + "pallet-timestamp/std", + "pallet-vesting/std", + "pallet-transaction-payment/std", ] runtime-benchmarks = [ "libsecp256k1/hmac", "frame-benchmarking", "frame-support/runtime-benchmarks", - "system/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] diff --git a/runtime/common/src/attestations.rs b/runtime/common/src/attestations.rs index e7a6854bbb13..6492f31cea79 100644 --- a/runtime/common/src/attestations.rs +++ b/runtime/common/src/attestations.rs @@ -33,7 +33,7 @@ use sp_runtime::RuntimeDebug; use sp_staking::SessionIndex; use inherents::{ProvideInherent, InherentData, MakeFatalError, InherentIdentifier}; -use system::ensure_none; +use frame_system::ensure_none; /// Parachain blocks included in a recent relay-chain block. #[derive(Encode, Decode)] @@ -76,9 +76,9 @@ impl RewardAttestation for () { } } -impl RewardAttestation for staking::Module { +impl RewardAttestation for pallet_staking::Module { fn reward_immediate(validator_indices: impl IntoIterator) { - use staking::SessionInterface; + use pallet_staking::SessionInterface; // The number of points to reward for a validity statement. // https://research.web3.foundation/en/latest/polkadot/Token%20Economics/#payment-details @@ -94,7 +94,7 @@ impl RewardAttestation for staking::Module { } } -pub trait Trait: session::Trait { +pub trait Trait: pallet_session::Trait { /// How many blocks ago we're willing to accept attestations for. type AttestationPeriod: Get; @@ -130,7 +130,7 @@ decl_error! { decl_module! { /// Parachain-attestations module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; /// Provide candidate receipts for parachains, in ascending order by id. diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index b56fa2ead7aa..6a51da0675d2 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -22,7 +22,7 @@ use frame_support::{ decl_event, decl_storage, decl_module, decl_error, ensure, dispatch::IsSubType, traits::{Currency, Get, VestingSchedule, EnsureOrigin}, weights::{Pays, DispatchClass} }; -use system::{ensure_signed, ensure_root, ensure_none}; +use frame_system::{ensure_signed, ensure_root, ensure_none}; use codec::{Encode, Decode}; #[cfg(feature = "std")] use serde::{self, Serialize, Deserialize, Serializer, Deserializer}; @@ -37,13 +37,13 @@ use sp_runtime::{ }; use primitives::v0::ValidityError; -type CurrencyOf = <::VestingSchedule as VestingSchedule<::AccountId>>::Currency; -type BalanceOf = as Currency<::AccountId>>::Balance; +type CurrencyOf = <::VestingSchedule as VestingSchedule<::AccountId>>::Currency; +type BalanceOf = as Currency<::AccountId>>::Balance; /// Configuration trait. -pub trait Trait: system::Trait { +pub trait Trait: frame_system::Trait { /// The overarching event type. - type Event: From> + Into<::Event>; + type Event: From> + Into<::Event>; type VestingSchedule: VestingSchedule; type Prefix: Get<&'static [u8]>; type MoveClaimOrigin: EnsureOrigin; @@ -130,7 +130,7 @@ impl sp_std::fmt::Debug for EcdsaSignature { decl_event!( pub enum Event where Balance = BalanceOf, - AccountId = ::AccountId + AccountId = ::AccountId { /// Someone claimed some DOTs. Claimed(AccountId, EthereumAddress, Balance), @@ -194,7 +194,7 @@ decl_storage! { } decl_module! { - pub struct Module for enum Call where origin: T::Origin, system = system { + pub struct Module for enum Call where origin: T::Origin { type Error = Error; /// The Prefix that is used in signed Ethereum messages for this network @@ -539,10 +539,10 @@ impl sp_runtime::traits::ValidateUnsigned for Module { /// otherwise free to place on chain. #[derive(Encode, Decode, Clone, Eq, PartialEq)] pub struct PrevalidateAttests(sp_std::marker::PhantomData) where - ::Call: IsSubType>; + ::Call: IsSubType>; impl Debug for PrevalidateAttests where - ::Call: IsSubType> + ::Call: IsSubType> { #[cfg(feature = "std")] fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { @@ -556,7 +556,7 @@ impl Debug for PrevalidateAttests where } impl PrevalidateAttests where - ::Call: IsSubType> + ::Call: IsSubType> { /// Create new `SignedExtension` to check runtime version. pub fn new() -> Self { @@ -565,10 +565,10 @@ impl PrevalidateAttests where } impl SignedExtension for PrevalidateAttests where - ::Call: IsSubType> + ::Call: IsSubType> { type AccountId = T::AccountId; - type Call = ::Call; + type Call = ::Call; type AdditionalSigned = (); type Pre = (); const IDENTIFIER: &'static str = "PrevalidateAttests"; @@ -642,11 +642,11 @@ mod tests { ord_parameter_types, weights::{Pays, GetDispatchInfo}, traits::ExistenceRequirement, dispatch::DispatchError::BadOrigin, }; - use balances; + use pallet_balances; use super::Call as ClaimsCall; impl_outer_origin! { - pub enum Origin for Test where system = system {} + pub enum Origin for Test {} } impl_outer_dispatch! { @@ -665,7 +665,7 @@ mod tests { pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } - impl system::Trait for Test { + impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = Call; @@ -687,7 +687,7 @@ mod tests { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = Balances; type SystemWeightInfo = (); @@ -699,7 +699,7 @@ mod tests { pub const MinVestedTransfer: u64 = 0; } - impl balances::Trait for Test { + impl pallet_balances::Trait for Test { type Balance = u64; type Event = (); type DustRemoval = (); @@ -708,7 +708,7 @@ mod tests { type WeightInfo = (); } - impl vesting::Trait for Test { + impl pallet_vesting::Trait for Test { type Event = (); type Currency = Balances; type BlockNumberToBalance = Identity; @@ -727,11 +727,11 @@ mod tests { type Event = (); type VestingSchedule = Vesting; type Prefix = Prefix; - type MoveClaimOrigin = system::EnsureSignedBy; + type MoveClaimOrigin = frame_system::EnsureSignedBy; } - type System = system::Module; - type Balances = balances::Module; - type Vesting = vesting::Module; + type System = frame_system::Module; + type Balances = pallet_balances::Module; + type Vesting = pallet_vesting::Module; type Claims = Module; fn alice() -> secp256k1::SecretKey { @@ -753,9 +753,9 @@ mod tests { // This function basically just builds a genesis storage key/value store according to // our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); // We use default for brevity, but you can configure as desired if needed. - balances::GenesisConfig::::default().assimilate_storage(&mut t).unwrap(); + pallet_balances::GenesisConfig::::default().assimilate_storage(&mut t).unwrap(); GenesisConfig::{ claims: vec![ (eth(&alice()), 100, None, None), @@ -982,7 +982,7 @@ mod tests { // Make sure we can not transfer the vested balance. assert_err!( >::transfer(&69, &80, 180, ExistenceRequirement::AllowDeath), - balances::Error::::LiquidityRestrictions, + pallet_balances::Error::::LiquidityRestrictions, ); }); } @@ -1167,8 +1167,7 @@ mod tests { mod benchmarking { use super::*; use secp_utils::*; - use system::RawOrigin; - use system as frame_system; // NOTE: required for the benchmarks! macro + use frame_system::RawOrigin; use frame_benchmarking::{benchmarks, account}; use sp_runtime::DispatchResult; use sp_runtime::traits::ValidateUnsigned; diff --git a/runtime/common/src/crowdfund.rs b/runtime/common/src/crowdfund.rs index 942b31976610..be4d8c0ffb96 100644 --- a/runtime/common/src/crowdfund.rs +++ b/runtime/common/src/crowdfund.rs @@ -72,7 +72,7 @@ use frame_support::{ Currency, Get, OnUnbalanced, WithdrawReason, ExistenceRequirement::AllowDeath }, }; -use system::ensure_signed; +use frame_system::ensure_signed; use sp_runtime::{ModuleId, traits::{AccountIdConversion, Hash, Saturating, Zero, CheckedAdd} }; @@ -82,13 +82,13 @@ use sp_std::vec::Vec; use primitives::v0::{Id as ParaId, HeadData}; pub type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; + <::Currency as Currency<::AccountId>>::Balance; #[allow(dead_code)] pub type NegativeImbalanceOf = - <::Currency as Currency<::AccountId>>::NegativeImbalance; + <::Currency as Currency<::AccountId>>::NegativeImbalance; pub trait Trait: slots::Trait { - type Event: From> + Into<::Event>; + type Event: From> + Into<::Event>; /// ModuleID for the crowdfund module. An appropriate value could be ```ModuleId(*b"py/cfund")``` type ModuleId: Get; @@ -184,7 +184,7 @@ decl_storage! { decl_event! { pub enum Event where - ::AccountId, + ::AccountId, Balance = BalanceOf, { Created(FundIndex), @@ -244,7 +244,7 @@ decl_error! { } decl_module! { - pub struct Module for enum Call where origin: T::Origin, system = system { + pub struct Module for enum Call where origin: T::Origin { type Error = Error; const ModuleId: ModuleId = T::ModuleId::get(); @@ -263,7 +263,7 @@ decl_module! { ensure!(first_slot < last_slot, Error::::LastSlotBeforeFirstSlot); ensure!(last_slot <= first_slot + 3.into(), Error::::LastSlotTooFarInFuture); - ensure!(end > >::block_number(), Error::::CannotEndInPast); + ensure!(end > >::block_number(), Error::::CannotEndInPast); let deposit = T::SubmissionDeposit::get(); let transfer = WithdrawReason::Transfer.into(); @@ -306,7 +306,7 @@ decl_module! { ensure!(fund.raised <= fund.cap, Error::::CapExceeded); // Make sure crowdfund has not ended - let now = >::block_number(); + let now = >::block_number(); ensure!(fund.end > now, Error::::ContributionPeriodOver); T::Currency::transfer(&who, &Self::fund_account_id(index), value, AllowDeath)?; @@ -394,7 +394,7 @@ decl_module! { ensure!(fund.parachain.is_none(), Error::::AlreadyOnboard); fund.parachain = Some(para_id); - let fund_origin = system::RawOrigin::Signed(Self::fund_account_id(index)).into(); + let fund_origin = frame_system::RawOrigin::Signed(Self::fund_account_id(index)).into(); >::fix_deploy_data( fund_origin, index, @@ -423,7 +423,7 @@ decl_module! { ensure!(T::Currency::free_balance(&account) >= fund.raised, Error::::FundsNotReturned); // This fund just ended. Withdrawal period begins. - let now = >::block_number(); + let now = >::block_number(); fund.end = now; >::insert(index, &fund); @@ -438,7 +438,7 @@ decl_module! { let mut fund = Self::funds(index).ok_or(Error::::InvalidFundIndex)?; ensure!(fund.parachain.is_none(), Error::::FundNotRetired); - let now = >::block_number(); + let now = >::block_number(); // `fund.end` can represent the end of a failed crowdsale or the beginning of retirement ensure!(now >= fund.end, Error::::FundNotEnded); @@ -469,7 +469,7 @@ decl_module! { let fund = Self::funds(index).ok_or(Error::::InvalidFundIndex)?; ensure!(fund.parachain.is_none(), Error::::HasActiveParachain); - let now = >::block_number(); + let now = >::block_number(); ensure!( now >= fund.end.saturating_add(T::RetirementPeriod::get()), Error::::InRetirementPeriod @@ -578,7 +578,7 @@ mod tests { use crate::registrar::Registrar; impl_outer_origin! { - pub enum Origin for Test where system = system {} + pub enum Origin for Test {} } // For testing the module, we construct most of a mock runtime. This means @@ -592,7 +592,7 @@ mod tests { pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } - impl system::Trait for Test { + impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = (); @@ -614,7 +614,7 @@ mod tests { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = Balances; type SystemWeightInfo = (); @@ -622,7 +622,7 @@ mod tests { parameter_types! { pub const ExistentialDeposit: u64 = 1; } - impl balances::Trait for Test { + impl pallet_balances::Trait for Test { type Balance = u64; type Event = (); type DustRemoval = (); @@ -653,10 +653,10 @@ mod tests { fn min_len() -> usize { 0 } fn max_len() -> usize { 0 } } - impl treasury::Trait for Test { - type Currency = balances::Module; - type ApproveOrigin = system::EnsureRoot; - type RejectOrigin = system::EnsureRoot; + impl pallet_treasury::Trait for Test { + type Currency = pallet_balances::Module; + type ApproveOrigin = frame_system::EnsureRoot; + type RejectOrigin = frame_system::EnsureRoot; type Event = (); type ProposalRejection = (); type ProposalBond = ProposalBond; @@ -756,20 +756,20 @@ mod tests { type ModuleId = CrowdfundModuleId; } - type System = system::Module; - type Balances = balances::Module; + type System = frame_system::Module; + type Balances = pallet_balances::Module; type Slots = slots::Module; - type Treasury = treasury::Module; + type Treasury = pallet_treasury::Module; type Crowdfund = Module; - type RandomnessCollectiveFlip = randomness_collective_flip::Module; - use balances::Error as BalancesError; + type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module; + use pallet_balances::Error as BalancesError; use slots::Error as SlotsError; // This function basically just builds a genesis storage key/value store according to // our desired mockup. fn new_test_ext() -> sp_io::TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); - balances::GenesisConfig::{ + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + pallet_balances::GenesisConfig::{ balances: vec![(1, 1000), (2, 2000), (3, 3000), (4, 4000)], }.assimilate_storage(&mut t).unwrap(); t.into() @@ -920,7 +920,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into() )); @@ -931,7 +931,7 @@ mod tests { assert_eq!( fund.deploy_data, Some(DeployData { - code_hash: ::Hash::default(), + code_hash: ::Hash::default(), code_size: 0, initial_head_data: vec![0].into(), }), @@ -950,7 +950,7 @@ mod tests { assert_noop!(Crowdfund::fix_deploy_data( Origin::signed(2), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into()), Error::::InvalidOrigin @@ -960,7 +960,7 @@ mod tests { assert_noop!(Crowdfund::fix_deploy_data( Origin::signed(1), 1, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into()), Error::::InvalidFundIndex @@ -970,7 +970,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -978,7 +978,7 @@ mod tests { assert_noop!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![1].into()), Error::::ExistingDeployData @@ -998,7 +998,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -1044,7 +1044,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -1072,7 +1072,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -1115,7 +1115,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -1257,7 +1257,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -1286,7 +1286,7 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); @@ -1325,14 +1325,14 @@ mod tests { assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(1), 0, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); assert_ok!(Crowdfund::fix_deploy_data( Origin::signed(2), 1, - ::Hash::default(), + ::Hash::default(), 0, vec![0].into(), )); diff --git a/runtime/common/src/impls.rs b/runtime/common/src/impls.rs index 7e3b6d917f77..47349d1f2ed9 100644 --- a/runtime/common/src/impls.rs +++ b/runtime/common/src/impls.rs @@ -25,20 +25,20 @@ pub struct ToAuthor(sp_std::marker::PhantomData); impl OnUnbalanced> for ToAuthor where - R: balances::Trait + authorship::Trait, - ::AccountId: From, - ::AccountId: Into, - ::Event: From::AccountId, - ::Balance, - balances::DefaultInstance> + R: pallet_balances::Trait + pallet_authorship::Trait, + ::AccountId: From, + ::AccountId: Into, + ::Event: From::AccountId, + ::Balance, + pallet_balances::DefaultInstance> >, { fn on_nonzero_unbalanced(amount: NegativeImbalance) { let numeric_amount = amount.peek(); - let author = >::author(); - >::resolve_creating(&>::author(), amount); - >::deposit_event(balances::RawEvent::Deposit(author, numeric_amount)); + let author = >::author(); + >::resolve_creating(&>::author(), amount); + >::deposit_event(pallet_balances::RawEvent::Deposit(author, numeric_amount)); } } @@ -47,18 +47,18 @@ pub struct CurrencyToVoteHandler(sp_std::marker::PhantomData); impl CurrencyToVoteHandler where - R: balances::Trait, + R: pallet_balances::Trait, R::Balance: Into, { fn factor() -> u128 { - let issuance: u128 = >::total_issuance().into(); + let issuance: u128 = >::total_issuance().into(); (issuance / u64::max_value() as u128).max(1) } } impl Convert for CurrencyToVoteHandler where - R: balances::Trait, + R: pallet_balances::Trait, R::Balance: Into, { fn convert(x: u128) -> u64 { (x / Self::factor()) as u64 } @@ -66,7 +66,7 @@ where impl Convert for CurrencyToVoteHandler where - R: balances::Trait, + R: pallet_balances::Trait, R::Balance: Into, { fn convert(x: u128) -> u128 { x * Self::factor() } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 3fb6e8140bb5..c512e822cf46 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -35,23 +35,23 @@ use frame_support::{ parameter_types, traits::{Currency}, weights::{Weight, constants::WEIGHT_PER_SECOND}, }; -use transaction_payment::{TargetedFeeAdjustment, Multiplier}; +use pallet_transaction_payment::{TargetedFeeAdjustment, Multiplier}; use static_assertions::const_assert; pub use frame_support::weights::constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; #[cfg(feature = "std")] -pub use staking::StakerStatus; +pub use pallet_staking::StakerStatus; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use timestamp::Call as TimestampCall; -pub use balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +pub use pallet_balances::Call as BalancesCall; pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER}; pub use parachains::Call as ParachainsCall; /// Implementations of some helper traits passed into runtime modules as associated types. pub use impls::{CurrencyToVoteHandler, ToAuthor}; -pub type NegativeImbalance = as Currency<::AccountId>>::NegativeImbalance; +pub type NegativeImbalance = as Currency<::AccountId>>::NegativeImbalance; /// We assume that an on-initialize consumes 10% of the weight on average, hence a single extrinsic /// will not be allowed to consume more than `AvailableBlockRatio - 10%`. @@ -107,7 +107,7 @@ mod multiplier_tests { pub struct Runtime; impl_outer_origin!{ - pub enum Origin for Runtime where system = system {} + pub enum Origin for Runtime {} } parameter_types! { @@ -118,7 +118,7 @@ mod multiplier_tests { pub const AvailableBlockRatio: Perbill = Perbill::one(); } - impl system::Trait for Runtime { + impl frame_system::Trait for Runtime { type BaseCallFilter = (); type Origin = Origin; type Index = u64; @@ -146,11 +146,11 @@ mod multiplier_tests { type SystemWeightInfo = (); } - type System = system::Module; + type System = frame_system::Module; fn run_with_system_weight(w: Weight, assertions: F) where F: Fn() -> () { let mut t: sp_io::TestExternalities = - system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::default().build_storage::().unwrap().into(); t.execute_with(|| { System::set_block_limits(w, 0); assertions() diff --git a/runtime/common/src/parachains.rs b/runtime/common/src/parachains.rs index a5d81989aa55..ce28012aae28 100644 --- a/runtime/common/src/parachains.rs +++ b/runtime/common/src/parachains.rs @@ -54,7 +54,7 @@ use sp_runtime::transaction_validity::InvalidTransaction; use inherents::{ProvideInherent, InherentData, MakeFatalError, InherentIdentifier}; -use system::{ +use frame_system::{ ensure_none, ensure_signed, offchain::{CreateSignedTransaction, SendSignedTransaction, Signer}, }; @@ -232,9 +232,9 @@ impl DoubleVoteReport { } } -impl Get> for ValidatorIdentities { +impl Get> for ValidatorIdentities { fn get() -> Vec { - >::validators() + >::validators() } } @@ -249,13 +249,13 @@ impl GetSessionNumber for sp_session::MembershipProof { } } -pub trait Trait: CreateSignedTransaction> + attestations::Trait + session::historical::Trait { +pub trait Trait: CreateSignedTransaction> + attestations::Trait + pallet_session::historical::Trait { // The transaction signing authority - type AuthorityId: system::offchain::AppCrypto; + type AuthorityId: frame_system::offchain::AppCrypto; /// The outer origin type. type Origin: From - + From<::Origin> + + From<::Origin> + Into::Origin>>; /// The outer call dispatch type. @@ -572,7 +572,7 @@ decl_error! { decl_module! { /// Parachains module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; fn on_initialize(now: T::BlockNumber) -> Weight { @@ -683,7 +683,7 @@ decl_module! { ) -> DispatchResult { let reporter = ensure_signed(origin)?; - let validators = >::validators(); + let validators = >::validators(); let validator_set_count = validators.len() as u32; let session_index = report.proof.session(); @@ -845,7 +845,7 @@ impl Module { } if let Some(code) = code { - Self::note_past_code(id, >::block_number(), code); + Self::note_past_code(id, >::block_number(), code); } } @@ -916,8 +916,8 @@ impl Module { /// Get a `SigningContext` with a current `SessionIndex` and parent hash. pub fn signing_context() -> SigningContext { - let session_index = >::current_index(); - let parent_hash = >::parent_hash(); + let session_index = >::current_index(); + let parent_hash = >::parent_hash(); SigningContext { session_index, @@ -948,11 +948,11 @@ impl Module { if let Ok(message_call) = ::Call::decode(&mut &data[..]) { let origin: ::Origin = match origin { ParachainDispatchOrigin::Signed => - ::Origin::from(::Origin::from(system::RawOrigin::Signed(id.into_account()))), + ::Origin::from(::Origin::from(frame_system::RawOrigin::Signed(id.into_account()))), ParachainDispatchOrigin::Parachain => Origin::Parachain(id).into(), ParachainDispatchOrigin::Root => - ::Origin::from(::Origin::from(system::RawOrigin::Root)), + ::Origin::from(::Origin::from(frame_system::RawOrigin::Root)), }; let _ok = message_call.dispatch(origin).is_ok(); // Not much to do with the result as it is. It's up to the parachain to ensure that the @@ -1169,7 +1169,7 @@ impl Module { /// Get the global validation schedule for all parachains. pub fn global_validation_data() -> GlobalValidationData { - let now = >::block_number(); + let now = >::block_number(); GlobalValidationData { max_code_size: T::MaxCodeSize::get(), max_head_data_size: T::MaxHeadDataSize::get(), @@ -1185,7 +1185,7 @@ impl Module { /// Get the local validation schedule for a particular parachain. pub fn local_validation_data(id: &ParaId, perceived_height: T::BlockNumber) -> Option { - if perceived_height + One::one() != >::block_number() { + if perceived_height + One::one() != >::block_number() { // sanity-check - no non-direct-parent blocks allowed at the moment. return None } @@ -1232,7 +1232,7 @@ impl Module { /// Get the local validation data for a particular parent w.r.t. the current /// block height. pub fn current_local_validation_data(id: &ParaId) -> Option { - let now: T::BlockNumber = >::block_number(); + let now: T::BlockNumber = >::block_number(); if now >= One::one() { Self::local_validation_data(id, now - One::one()) } else { @@ -1353,8 +1353,8 @@ impl Module { let sorted_validators = make_sorted_duties(&duty_roster.validator_duty); - let relay_height_now = >::block_number(); - let parent_hash = >::parent_hash(); + let relay_height_now = >::block_number(); + let parent_hash = >::parent_hash(); let signing_context = Self::signing_context(); let code_upgrade_delay = T::ValidationUpgradeDelay::get(); @@ -1380,7 +1380,7 @@ impl Module { ); // Since we only allow execution in context of parent hash. - let perceived_relay_block_height = >::block_number() - One::one(); + let perceived_relay_block_height = >::block_number() - One::one(); ensure!( candidate.validity_votes.len() >= majority_of(validator_group.len()), @@ -1452,7 +1452,7 @@ impl Module { Ok(IncludedBlocks { actual_number: relay_height_now, - session: >::current_index(), + session: >::current_index(), random_seed, active_parachains: active_parachains.iter().map(|x| x.0).collect(), para_blocks: para_block_hashes, @@ -1506,7 +1506,7 @@ impl sp_runtime::BoundToRuntimeAppPublic for Module { type Public = ValidatorId; } -impl session::OneSessionHandler for Module { +impl pallet_session::OneSessionHandler for Module { type Key = ValidatorId; fn on_genesis_session<'a, I: 'a>(validators: I) @@ -1602,11 +1602,11 @@ pub enum DoubleVoteValidityError { } impl SignedExtension for ValidateDoubleVoteReports where - ::Call: IsSubType> + ::Call: IsSubType> { const IDENTIFIER: &'static str = "ValidateDoubleVoteReports"; type AccountId = T::AccountId; - type Call = ::Call; + type Call = ::Call; type AdditionalSigned = (); type Pre = (); @@ -1627,7 +1627,7 @@ impl SignedExtension for ValidateDoubleVoteReports wh if let Some(local_call) = call.is_sub_type() { if let Call::report_double_vote(report) = local_call { - let validators = >::validators(); + let validators = >::validators(); let expected_session = report.signing_context.session_index; let session = report.proof.session(); @@ -1692,8 +1692,8 @@ mod tests { use crate::parachains; use crate::registrar; use crate::slots; - use session::{SessionHandler, SessionManager}; - use staking::EraIndex; + use pallet_session::{SessionHandler, SessionManager}; + use pallet_staking::EraIndex; // result of as trie_db::NodeCodec>::hashed_null_node() const EMPTY_TRIE_ROOT: [u8; 32] = [ @@ -1702,7 +1702,7 @@ mod tests { ]; impl_outer_origin! { - pub enum Origin for Test where system = system { + pub enum Origin for Test { parachains } } @@ -1729,7 +1729,7 @@ mod tests { pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } - impl system::Trait for Test { + impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = Call; @@ -1751,13 +1751,13 @@ mod tests { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } - impl system::offchain::SendTransactionTypes for Test where + impl frame_system::offchain::SendTransactionTypes for Test where Call: From, { type OverarchingCall = Call; @@ -1784,28 +1784,28 @@ mod tests { fn on_disabled(_: usize) {} } - impl session::Trait for Test { + impl pallet_session::Trait for Test { type Event = (); type ValidatorId = u64; - type ValidatorIdOf = staking::StashOf; - type ShouldEndSession = session::PeriodicSessions; - type NextSessionRotation = session::PeriodicSessions; - type SessionManager = session::historical::NoteHistoricalRoot; + type ValidatorIdOf = pallet_staking::StashOf; + type ShouldEndSession = pallet_session::PeriodicSessions; + type NextSessionRotation = pallet_session::PeriodicSessions; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = TestSessionHandler; type Keys = TestSessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; type WeightInfo = (); } - impl session::historical::Trait for Test { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; + impl pallet_session::historical::Trait for Test { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } parameter_types! { pub const MinimumPeriod: u64 = 3; } - impl timestamp::Trait for Test { + impl pallet_timestamp::Trait for Test { type Moment = u64; type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; @@ -1825,23 +1825,23 @@ mod tests { pub const ExpectedBlockTime: u64 = time::MILLISECS_PER_BLOCK; } - impl babe::Trait for Test { + impl pallet_babe::Trait for Test { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = (); type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = (); @@ -1851,7 +1851,7 @@ mod tests { pub const ExistentialDeposit: Balance = 1; } - impl balances::Trait for Test { + impl pallet_balances::Trait for Test { type Balance = u128; type DustRemoval = (); type Event = (); @@ -1873,8 +1873,8 @@ mod tests { parameter_types! { pub const SessionsPerEra: sp_staking::SessionIndex = 3; - pub const BondingDuration: staking::EraIndex = 3; - pub const SlashDeferDuration: staking::EraIndex = 0; + pub const BondingDuration: pallet_staking::EraIndex = 3; + pub const SlashDeferDuration: pallet_staking::EraIndex = 0; pub const AttestationPeriod: BlockNumber = 100; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; @@ -1892,7 +1892,7 @@ mod tests { fn convert(x: u128) -> u64 { x.saturated_into() } } - impl staking::Trait for Test { + impl pallet_staking::Trait for Test { type RewardRemainder = (); type CurrencyToVote = CurrencyToVoteHandler; type Event = (); @@ -1902,9 +1902,9 @@ mod tests { type SessionsPerEra = SessionsPerEra; type BondingDuration = BondingDuration; type SlashDeferDuration = SlashDeferDuration; - type SlashCancelOrigin = system::EnsureRoot; + type SlashCancelOrigin = frame_system::EnsureRoot; type SessionInterface = Self; - type UnixTime = timestamp::Module; + type UnixTime = pallet_timestamp::Module; type RewardCurve = RewardCurve; type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; type NextNewSession = Session; @@ -1956,9 +1956,9 @@ mod tests { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } - impl offences::Trait for Test { + impl pallet_offences::Trait for Test { type Event = (); - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); @@ -1995,7 +1995,7 @@ mod tests { pub type ReporterId = app::Public; pub struct ReporterAuthorityId; - impl system::offchain::AppCrypto for ReporterAuthorityId { + impl frame_system::offchain::AppCrypto for ReporterAuthorityId { type RuntimeAppPublic = ReporterId; type GenericSignature = sr25519::Signature; type GenericPublic = sr25519::Public; @@ -2027,40 +2027,40 @@ mod tests { type Extrinsic = TestXt; - impl system::offchain::CreateSignedTransaction for Test where + impl frame_system::offchain::CreateSignedTransaction for Test where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, _public: test_keys::ReporterId, - _account: ::AccountId, - nonce: ::Index, + _account: ::AccountId, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { Some((call, (nonce, ()))) } } - impl system::offchain::SigningTypes for Test { + impl frame_system::offchain::SigningTypes for Test { type Public = test_keys::ReporterId; type Signature = sr25519::Signature; } type Parachains = Module; - type Balances = balances::Module; - type System = system::Module; - type Offences = offences::Module; - type Staking = staking::Module; - type Session = session::Module; - type Timestamp = timestamp::Module; - type RandomnessCollectiveFlip = randomness_collective_flip::Module; + type Balances = pallet_balances::Module; + type System = frame_system::Module; + type Offences = pallet_offences::Module; + type Staking = pallet_staking::Module; + type Session = pallet_session::Module; + type Timestamp = pallet_timestamp::Module; + type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module; type Registrar = registrar::Module; - type Historical = session::historical::Module; + type Historical = pallet_session::historical::Module; fn new_test_ext(parachains: Vec<(ParaId, ValidationCode, HeadData)>) -> TestExternalities { - use staking::StakerStatus; - use babe::AuthorityId as BabeAuthorityId; + use pallet_staking::StakerStatus; + use pallet_babe::AuthorityId as BabeAuthorityId; - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); let authority_keys = [ Sr25519Keyring::Alice, @@ -2105,22 +2105,22 @@ mod tests { _phdata: Default::default(), }.assimilate_storage(&mut t).unwrap(); - session::GenesisConfig:: { + pallet_session::GenesisConfig:: { keys: session_keys, }.assimilate_storage(&mut t).unwrap(); - babe::GenesisConfig { + pallet_babe::GenesisConfig { authorities: babe_authorities, }.assimilate_storage::(&mut t).unwrap(); - balances::GenesisConfig:: { + pallet_balances::GenesisConfig:: { balances, }.assimilate_storage(&mut t).unwrap(); - staking::GenesisConfig:: { + pallet_staking::GenesisConfig:: { stakers, validator_count: 8, - force_era: staking::Forcing::ForceNew, + force_era: pallet_staking::Forcing::ForceNew, minimum_validator_count: 0, invulnerables: vec![], .. Default::default() @@ -3161,7 +3161,7 @@ mod tests { assert_eq!( Staking::eras_stakers(1, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3192,7 +3192,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, 0), - staking::Exposure { + pallet_staking::Exposure { total: 0, own: 0, others: vec![], @@ -3206,7 +3206,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3256,7 +3256,7 @@ mod tests { assert_eq!( Staking::eras_stakers(1, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3285,7 +3285,7 @@ mod tests { assert_eq!( Staking::eras_stakers(Staking::current_era().unwrap(), 0), - staking::Exposure { + pallet_staking::Exposure { total: 0, own: 0, others: vec![], @@ -3299,7 +3299,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3350,7 +3350,7 @@ mod tests { assert_eq!( Staking::eras_stakers(1, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3379,7 +3379,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, 0), - staking::Exposure { + pallet_staking::Exposure { total: 0, own: 0, others: vec![], @@ -3393,7 +3393,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3447,7 +3447,7 @@ mod tests { assert_eq!( Staking::eras_stakers(1, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3479,7 +3479,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, 0), - staking::Exposure { + pallet_staking::Exposure { total: 0, own: 0, others: vec![], @@ -3493,7 +3493,7 @@ mod tests { assert_eq!( Staking::eras_stakers(2, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3611,7 +3611,7 @@ mod tests { assert_eq!( Staking::eras_stakers(1, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], @@ -3643,7 +3643,7 @@ mod tests { assert_eq!( Staking::eras_stakers(1, i as u64), - staking::Exposure { + pallet_staking::Exposure { total: 10_000, own: 10_000, others: vec![], diff --git a/runtime/common/src/paras_sudo_wrapper.rs b/runtime/common/src/paras_sudo_wrapper.rs index e1e1ccae095b..d165123b422f 100644 --- a/runtime/common/src/paras_sudo_wrapper.rs +++ b/runtime/common/src/paras_sudo_wrapper.rs @@ -21,7 +21,7 @@ use frame_support::{ dispatch::DispatchResult, weights::DispatchClass, }; -use system::ensure_root; +use frame_system::ensure_root; use runtime_parachains::paras::{ self, ParaGenesisArgs, @@ -37,7 +37,7 @@ decl_error! { decl_module! { /// A sudo wrapper to call into v1 paras module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; /// Schedule a para to be initialized at the start of the next session. diff --git a/runtime/common/src/purchase.rs b/runtime/common/src/purchase.rs index 9a1856a549df..ff36013f55a2 100644 --- a/runtime/common/src/purchase.rs +++ b/runtime/common/src/purchase.rs @@ -23,14 +23,14 @@ use frame_support::{decl_event, decl_storage, decl_module, decl_error, ensure}; use frame_support::traits::{ EnsureOrigin, Currency, ExistenceRequirement, VestingSchedule, Get }; -use system::ensure_signed; +use frame_system::ensure_signed; use sp_core::sr25519; use sp_std::prelude::*; /// Configuration trait. -pub trait Trait: system::Trait { +pub trait Trait: frame_system::Trait { /// The overarching event type. - type Event: From> + Into<::Event>; + type Event: From> + Into<::Event>; /// Balances Pallet type Currency: Currency; /// Vesting Pallet @@ -47,7 +47,7 @@ pub trait Trait: system::Trait { type MaxUnlocked: Get>; } -type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; +type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; /// The kind of a statement an account needs to make for a claim to be valid. #[derive(Encode, Decode, Clone, Copy, Eq, PartialEq, RuntimeDebug)] @@ -103,9 +103,9 @@ pub struct AccountStatus { decl_event!( pub enum Event where - AccountId = ::AccountId, + AccountId = ::AccountId, Balance = BalanceOf, - BlockNumber = ::BlockNumber, + BlockNumber = ::BlockNumber, { /// A new account was created AccountCreated(AccountId), @@ -159,7 +159,7 @@ decl_storage! { } decl_module! { - pub struct Module for enum Call where origin: T::Origin, system = system { + pub struct Module for enum Call where origin: T::Origin { type Error = Error; /// The maximum statement length for the statement users to sign when creating an account. @@ -332,7 +332,7 @@ decl_module! { #[weight = T::DbWeight::get().writes(1)] fn set_unlock_block(origin, unlock_block: T::BlockNumber) { T::ConfigurationOrigin::ensure_origin(origin)?; - ensure!(unlock_block > system::Module::::block_number(), Error::::InvalidUnlockBlock); + ensure!(unlock_block > frame_system::Module::::block_number(), Error::::InvalidUnlockBlock); // Possibly this is worse than having the caller account be the payment account? UnlockBlock::::set(unlock_block); Self::deposit_event(RawEvent::UnlockBlockUpdated(unlock_block)); @@ -388,10 +388,10 @@ mod tests { ord_parameter_types, dispatch::DispatchError::BadOrigin, }; use frame_support::traits::Currency; - use balances::Error as BalancesError; + use pallet_balances::Error as BalancesError; impl_outer_origin! { - pub enum Origin for Test where system = system {} + pub enum Origin for Test {} } impl_outer_dispatch! { @@ -414,7 +414,7 @@ mod tests { pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } - impl system::Trait for Test { + impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = Call; @@ -436,7 +436,7 @@ mod tests { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = Balances; type SystemWeightInfo = (); @@ -446,7 +446,7 @@ mod tests { pub const ExistentialDeposit: u64 = 1; } - impl balances::Trait for Test { + impl pallet_balances::Trait for Test { type Balance = u64; type Event = (); type DustRemoval = (); @@ -459,7 +459,7 @@ mod tests { pub const MinVestedTransfer: u64 = 0; } - impl vesting::Trait for Test { + impl pallet_vesting::Trait for Test { type Event = (); type Currency = Balances; type BlockNumberToBalance = Identity; @@ -483,22 +483,22 @@ mod tests { type Event = (); type Currency = Balances; type VestingSchedule = Vesting; - type ValidityOrigin = system::EnsureSignedBy; - type ConfigurationOrigin = system::EnsureSignedBy; + type ValidityOrigin = frame_system::EnsureSignedBy; + type ConfigurationOrigin = frame_system::EnsureSignedBy; type MaxStatementLength = MaxStatementLength; type UnlockedProportion = UnlockedProportion; type MaxUnlocked = MaxUnlocked; } - type System = system::Module; - type Balances = balances::Module; - type Vesting = vesting::Module; + type System = frame_system::Module; + type Balances = pallet_balances::Module; + type Vesting = pallet_vesting::Module; type Purchase = Module; // This function basically just builds a genesis storage key/value store according to // our desired mockup. It also executes our `setup` function which sets up this pallet for use. pub fn new_test_ext() -> sp_io::TestExternalities { - let t = system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| setup()); ext @@ -948,7 +948,7 @@ mod tests { ); // Vesting lock is removed in whole on block 101 (100 blocks after block 1) System::set_block_number(100); - let vest_call = Call::Vesting(vesting::Call::::vest()); + let vest_call = Call::Vesting(pallet_vesting::Call::::vest()); assert_ok!(vest_call.clone().dispatch(Origin::signed(alice()))); assert_ok!(vest_call.clone().dispatch(Origin::signed(bob()))); assert_eq!(::VestingSchedule::vesting_balance(&alice()), Some(45)); diff --git a/runtime/common/src/registrar.rs b/runtime/common/src/registrar.rs index bf56d733ca1a..eeb4552feea2 100644 --- a/runtime/common/src/registrar.rs +++ b/runtime/common/src/registrar.rs @@ -33,7 +33,7 @@ use frame_support::{ dispatch::{DispatchResult, IsSubType}, traits::{Get, Currency, ReservableCurrency}, weights::{DispatchClass, Weight}, }; -use system::{self, ensure_root, ensure_signed}; +use frame_system::{self, ensure_root, ensure_signed}; use primitives::v0::{ Id as ParaId, CollatorId, Scheduling, LOWEST_USER_ID, SwapAux, Info as ParaInfo, ActiveParas, Retriable, ValidationCode, HeadData, @@ -129,17 +129,17 @@ impl Registrar for Module { } type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; + <::Currency as Currency<::AccountId>>::Balance; pub trait Trait: parachains::Trait { /// The overarching event type. - type Event: From + Into<::Event>; + type Event: From + Into<::Event>; /// The aggregated origin type must support the parachains origin. We require that we can /// infallibly convert between this origin and the system origin, but in reality, they're the /// same type, we just can't express that to the Rust type system without writing a `where` /// clause everywhere. - type Origin: From<::Origin> + type Origin: From<::Origin> + Into::Origin>>; /// The system's currency for parathread payment. @@ -254,7 +254,7 @@ decl_error! { decl_module! { /// Parachains module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; fn deposit_event() = default; @@ -561,10 +561,10 @@ impl ActiveParas for Module { /// Ensure that parathread selections happen prioritized by fees. #[derive(Encode, Decode, Clone, Eq, PartialEq)] pub struct LimitParathreadCommits(sp_std::marker::PhantomData) where - ::Call: IsSubType>; + ::Call: IsSubType>; impl LimitParathreadCommits where - ::Call: IsSubType> + ::Call: IsSubType> { /// Create a new `LimitParathreadCommits` struct. pub fn new() -> Self { @@ -573,7 +573,7 @@ impl LimitParathreadCommits where } impl sp_std::fmt::Debug for LimitParathreadCommits where - ::Call: IsSubType> + ::Call: IsSubType> { fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { write!(f, "LimitParathreadCommits") @@ -590,11 +590,11 @@ pub enum ValidityError { } impl SignedExtension for LimitParathreadCommits where - ::Call: IsSubType> + ::Call: IsSubType> { const IDENTIFIER: &'static str = "LimitParathreadCommits"; type AccountId = T::AccountId; - type Call = ::Call; + type Call = ::Call; type AdditionalSigned = (); type Pre = (); @@ -688,7 +688,7 @@ mod tests { use crate::attestations; impl_outer_origin! { - pub enum Origin for Test where system = system { + pub enum Origin for Test { parachains, } } @@ -720,7 +720,7 @@ mod tests { pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } - impl system::Trait for Test { + impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = Call; @@ -742,13 +742,13 @@ mod tests { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = Balances; type SystemWeightInfo = (); } - impl system::offchain::SendTransactionTypes for Test where + impl frame_system::offchain::SendTransactionTypes for Test where Call: From, { type OverarchingCall = Call; @@ -759,7 +759,7 @@ mod tests { pub const ExistentialDeposit: Balance = 1; } - impl balances::Trait for Test { + impl pallet_balances::Trait for Test { type Balance = u128; type DustRemoval = (); type Event = (); @@ -775,7 +775,7 @@ mod tests { impl slots::Trait for Test { type Event = (); - type Currency = balances::Module; + type Currency = pallet_balances::Module; type Parachains = Registrar; type EndingPeriod = EndingPeriod; type LeasePeriod = LeasePeriod; @@ -783,11 +783,11 @@ mod tests { } parameter_types!{ - pub const SlashDeferDuration: staking::EraIndex = 7; + pub const SlashDeferDuration: pallet_staking::EraIndex = 7; pub const AttestationPeriod: BlockNumber = 100; pub const MinimumPeriod: u64 = 3; pub const SessionsPerEra: sp_staking::SessionIndex = 6; - pub const BondingDuration: staking::EraIndex = 28; + pub const BondingDuration: pallet_staking::EraIndex = 28; pub const MaxNominatorRewardedPerValidator: u32 = 64; } @@ -804,12 +804,12 @@ mod tests { pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; } - impl session::Trait for Test { + impl pallet_session::Trait for Test { type SessionManager = (); type Keys = UintAuthorityId; - type ShouldEndSession = session::PeriodicSessions; - type NextSessionRotation = session::PeriodicSessions; - type SessionHandler = session::TestSessionHandler; + type ShouldEndSession = pallet_session::PeriodicSessions; + type NextSessionRotation = pallet_session::PeriodicSessions; + type SessionHandler = pallet_session::TestSessionHandler; type Event = (); type ValidatorId = u64; type ValidatorIdOf = (); @@ -828,19 +828,19 @@ mod tests { pub const StakingUnsignedPriority: u64 = u64::max_value() / 2; } - impl staking::Trait for Test { + impl pallet_staking::Trait for Test { type RewardRemainder = (); type CurrencyToVote = (); type Event = (); - type Currency = balances::Module; + type Currency = pallet_balances::Module; type Slash = (); type Reward = (); type SessionsPerEra = SessionsPerEra; type BondingDuration = BondingDuration; type SlashDeferDuration = SlashDeferDuration; - type SlashCancelOrigin = system::EnsureRoot; + type SlashCancelOrigin = frame_system::EnsureRoot; type SessionInterface = Self; - type UnixTime = timestamp::Module; + type UnixTime = pallet_timestamp::Module; type RewardCurve = RewardCurve; type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; type NextNewSession = Session; @@ -852,16 +852,16 @@ mod tests { type WeightInfo = (); } - impl timestamp::Trait for Test { + impl pallet_timestamp::Trait for Test { type Moment = u64; type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; type WeightInfo = (); } - impl session::historical::Trait for Test { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; + impl pallet_session::historical::Trait for Test { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } // This is needed for a custom `AccountId` type which is `u64` in testing here. @@ -889,7 +889,7 @@ mod tests { pub type ReporterId = app::Public; pub struct ReporterAuthorityId; - impl system::offchain::AppCrypto for ReporterAuthorityId { + impl frame_system::offchain::AppCrypto for ReporterAuthorityId { type RuntimeAppPublic = ReporterId; type GenericSignature = sr25519::Signature; type GenericPublic = sr25519::Public; @@ -900,7 +900,7 @@ mod tests { type AuthorityId = test_keys::ReporterAuthorityId; type Origin = Origin; type Call = Call; - type ParachainCurrency = balances::Module; + type ParachainCurrency = pallet_balances::Module; type BlockNumberConversion = sp_runtime::traits::Identity; type ActiveParachains = Registrar; type Registrar = Registrar; @@ -911,7 +911,7 @@ mod tests { type ValidationUpgradeDelay = ValidationUpgradeDelay; type SlashPeriod = SlashPeriod; type Proof = sp_session::MembershipProof; - type KeyOwnerProofSystem = session::historical::Module; + type KeyOwnerProofSystem = pallet_session::historical::Module; type IdentificationTuple = , @@ -922,20 +922,20 @@ mod tests { type Extrinsic = TestXt; - impl system::offchain::CreateSignedTransaction for Test where + impl frame_system::offchain::CreateSignedTransaction for Test where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, _public: test_keys::ReporterId, - _account: ::AccountId, - nonce: ::Index, + _account: ::AccountId, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { Some((call, (nonce, ()))) } } - impl system::offchain::SigningTypes for Test { + impl frame_system::offchain::SigningTypes for Test { type Public = test_keys::ReporterId; type Signature = Signature; } @@ -949,21 +949,21 @@ mod tests { impl Trait for Test { type Event = (); type Origin = Origin; - type Currency = balances::Module; + type Currency = pallet_balances::Module; type ParathreadDeposit = ParathreadDeposit; type SwapAux = slots::Module; type QueueSize = QueueSize; type MaxRetries = MaxRetries; } - type Balances = balances::Module; + type Balances = pallet_balances::Module; type Parachains = parachains::Module; - type System = system::Module; + type System = frame_system::Module; type Slots = slots::Module; type Registrar = Module; - type RandomnessCollectiveFlip = randomness_collective_flip::Module; - type Session = session::Module; - type Staking = staking::Module; + type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module; + type Session = pallet_session::Module; + type Staking = pallet_staking::Module; const AUTHORITY_KEYS: [Sr25519Keyring; 8] = [ Sr25519Keyring::Alice, @@ -977,7 +977,7 @@ mod tests { ]; fn new_test_ext(parachains: Vec<(ParaId, ValidationCode, HeadData)>) -> TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); let authority_keys = [ Sr25519Keyring::Alice, @@ -1008,11 +1008,11 @@ mod tests { _phdata: Default::default(), }.assimilate_storage(&mut t).unwrap(); - session::GenesisConfig:: { + pallet_session::GenesisConfig:: { keys: session_keys, }.assimilate_storage(&mut t).unwrap(); - balances::GenesisConfig:: { + pallet_balances::GenesisConfig:: { balances, }.assimilate_storage(&mut t).unwrap(); @@ -1034,7 +1034,7 @@ mod tests { println!("Finalizing {}", System::block_number()); if !parachains::DidUpdate::exists() { println!("Null heads update"); - assert_ok!(Parachains::set_heads(system::RawOrigin::None.into(), vec![])); + assert_ok!(Parachains::set_heads(frame_system::RawOrigin::None.into(), vec![])); } Slots::on_finalize(System::block_number()); Parachains::on_finalize(System::block_number()); @@ -1082,7 +1082,7 @@ mod tests { }; let (candidate, _) = candidate.abridge(); let candidate_hash = candidate.hash(); - let payload = (Statement::Valid(candidate_hash), session::Module::::current_index(), System::parent_hash()).encode(); + let payload = (Statement::Valid(candidate_hash), pallet_session::Module::::current_index(), System::parent_hash()).encode(); let roster = Parachains::calculate_duty_roster().0.validator_duty; AttestedCandidate { candidate, @@ -1498,8 +1498,8 @@ mod tests { let good_para_id = user_id(0); let bad_para_id = user_id(1); - let bad_head_hash = ::Hashing::hash(&vec![1, 2, 1]); - let good_head_hash = ::Hashing::hash(&vec![1, 1, 1]); + let bad_head_hash = ::Hashing::hash(&vec![1, 2, 1]); + let good_head_hash = ::Hashing::hash(&vec![1, 1, 1]); let info = &DispatchInfo::default(); // Allow for threads @@ -1562,7 +1562,7 @@ mod tests { for x in 0..5 { let para_id = user_id(x as u32); let collator_id = CollatorId::default(); - let head_hash = ::Hashing::hash(&vec![x; 3]); + let head_hash = ::Hashing::hash(&vec![x; 3]); let inner = super::Call::select_parathread(para_id, collator_id, head_hash); let call = Call::Registrar(inner); let info = &DispatchInfo::default(); diff --git a/runtime/common/src/slots.rs b/runtime/common/src/slots.rs index 5fe4c3b048ad..0731900c5adf 100644 --- a/runtime/common/src/slots.rs +++ b/runtime/common/src/slots.rs @@ -31,16 +31,16 @@ use frame_support::{ use primitives::v0::{ SwapAux, PARACHAIN_INFO, Id as ParaId, ValidationCode, HeadData, }; -use system::{ensure_signed, ensure_root}; +use frame_system::{ensure_signed, ensure_root}; use crate::registrar::{Registrar, swap_ordered_existence}; use crate::slot_range::{SlotRange, SLOT_RANGE_COUNT}; -type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; +type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; /// The module's configuration trait. -pub trait Trait: system::Trait { +pub trait Trait: frame_system::Trait { /// The overarching event type. - type Event: From> + Into<::Event>; + type Event: From> + Into<::Event>; /// The currency type used for bidding. type Currency: ReservableCurrency; @@ -118,14 +118,14 @@ pub enum IncomingParachain { Deploy { code: ValidationCode, initial_head_data: HeadData }, } -type LeasePeriodOf = ::BlockNumber; +type LeasePeriodOf = ::BlockNumber; // Winning data type. This encodes the top bidders of each range together with their bid. type WinningData = - [Option<(Bidder<::AccountId>, BalanceOf)>; SLOT_RANGE_COUNT]; + [Option<(Bidder<::AccountId>, BalanceOf)>; SLOT_RANGE_COUNT]; // Winners data type. This encodes each of the final winners of a parachain auction, the parachain // index assigned to them, their winning bid and the range that they won. type WinnersData = - Vec<(Option::AccountId>>, ParaId, BalanceOf, SlotRange)>; + Vec<(Option::AccountId>>, ParaId, BalanceOf, SlotRange)>; // This module's storage items. decl_storage! { @@ -204,8 +204,8 @@ impl SwapAux for Module { decl_event!( pub enum Event where - AccountId = ::AccountId, - BlockNumber = ::BlockNumber, + AccountId = ::AccountId, + BlockNumber = ::BlockNumber, LeasePeriod = LeasePeriodOf, ParaId = ParaId, Balance = BalanceOf, @@ -262,7 +262,7 @@ decl_error! { } decl_module! { - pub struct Module for enum Call where origin: T::Origin, system = system { + pub struct Module for enum Call where origin: T::Origin { type Error = Error; fn deposit_event() = default; @@ -322,7 +322,7 @@ decl_module! { let n = ::mutate(|n| { *n += 1; *n }); // Set the information. - let ending = >::block_number() + duration; + let ending = >::block_number() + duration; >::put((lease_period_index, ending)); Self::deposit_event(RawEvent::AuctionStarted(n, lease_period_index, ending)) @@ -459,7 +459,7 @@ decl_module! { .ok_or(Error::::ParaNotOnboarding)?; if let IncomingParachain::Fixed{code_hash, code_size, initial_head_data} = details { ensure!(code.0.len() as u32 == code_size, Error::::InvalidCode); - ensure!(::Hashing::hash(&code.0) == code_hash, Error::::InvalidCode); + ensure!(::Hashing::hash(&code.0) == code_hash, Error::::InvalidCode); if starts > Self::lease_period_index() { // Hasn't yet begun. Replace the on-boarding entry with the new information. @@ -507,7 +507,7 @@ impl Module { /// Returns the current lease period. fn lease_period_index() -> LeasePeriodOf { - (>::block_number() / T::LeasePeriod::get()).into() + (>::block_number() / T::LeasePeriod::get()).into() } /// Some when the auction's end is known (with the end block number). None if it is unknown. @@ -751,7 +751,7 @@ impl Module { // Range as an array index. let range_index = range as u8 as usize; // The offset into the auction ending set. - let offset = Self::is_ending(>::block_number()).unwrap_or_default(); + let offset = Self::is_ending(>::block_number()).unwrap_or_default(); // The current winning ranges. let mut current_winning = >::get(offset) .or_else(|| offset.checked_sub(&One::one()).and_then(>::get)) @@ -889,11 +889,11 @@ mod tests { impl_outer_origin, parameter_types, assert_ok, assert_noop, traits::{OnInitialize, OnFinalize} }; - use balances; + use pallet_balances; use primitives::v0::{BlockNumber, Header, Id as ParaId, Info as ParaInfo, Scheduling}; impl_outer_origin! { - pub enum Origin for Test where system = system {} + pub enum Origin for Test {} } // For testing the module, we construct most of a mock runtime. This means @@ -907,7 +907,7 @@ mod tests { pub const MaximumBlockLength: u32 = 4 * 1024 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } - impl system::Trait for Test { + impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = (); @@ -929,7 +929,7 @@ mod tests { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = Balances; type SystemWeightInfo = (); @@ -939,7 +939,7 @@ mod tests { pub const ExistentialDeposit: u64 = 1; } - impl balances::Trait for Test { + impl pallet_balances::Trait for Test { type Balance = u64; type Event = (); type DustRemoval = (); @@ -1025,16 +1025,16 @@ mod tests { type Randomness = RandomnessCollectiveFlip; } - type System = system::Module; - type Balances = balances::Module; + type System = frame_system::Module; + type Balances = pallet_balances::Module; type Slots = Module; - type RandomnessCollectiveFlip = randomness_collective_flip::Module; + type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module; // This function basically just builds a genesis storage key/value store according to // our desired mock up. fn new_test_ext() -> sp_io::TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); - balances::GenesisConfig::{ + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + pallet_balances::GenesisConfig::{ balances: vec![(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)], }.assimilate_storage(&mut t).unwrap(); t.into() diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index b8f2e5a248f8..8b56dc17fa18 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -26,44 +26,44 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -version = { package = "sp-version", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authority-discovery = { package = "pallet-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -collective = { package = "pallet-collective", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -democracy = { package = "pallet-democracy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -membership = { package = "pallet-membership", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -multisig = { package = "pallet-multisig", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -proxy = { package = "pallet-proxy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -recovery = { package = "pallet-recovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -scheduler = { package = "pallet-scheduler", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -society = { package = "pallet-society", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-finality-tracker = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -utility = { package = "pallet-utility", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -91,7 +91,7 @@ no_std = [] only-staking = [] std = [ "authority-discovery-primitives/std", - "authority-discovery/std", + "pallet-authority-discovery/std", "bitvec/std", "primitives/std", "rustc-hex/std", @@ -105,45 +105,45 @@ std = [ "sp-std/std", "sp-io/std", "frame-support/std", - "authorship/std", - "balances/std", - "transaction-payment/std", - "transaction-payment-rpc-runtime-api/std", - "collective/std", - "elections-phragmen/std", - "democracy/std", - "executive/std", - "finality-tracker/std", - "grandpa/std", - "identity/std", - "im-online/std", - "indices/std", - "membership/std", - "multisig/std", - "nicks/std", - "offences/std", - "proxy/std", - "recovery/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-collective/std", + "pallet-elections-phragmen/std", + "pallet-democracy/std", + "frame-executive/std", + "pallet-finality-tracker/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-indices/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-nicks/std", + "pallet-offences/std", + "pallet-proxy/std", + "pallet-recovery/std", "sp-runtime/std", "sp-staking/std", - "scheduler/std", - "session/std", - "society/std", - "staking/std", - "system/std", - "system_rpc_runtime_api/std", - "timestamp/std", - "treasury/std", - "version/std", - "utility/std", - "vesting/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-society/std", + "pallet-staking/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "pallet-timestamp/std", + "pallet-treasury/std", + "sp-version/std", + "pallet-utility/std", + "pallet-vesting/std", "serde_derive", "serde/std", "log", - "babe/std", + "pallet-babe/std", "babe-primitives/std", "sp-session/std", - "randomness-collective-flip/std", + "pallet-randomness-collective-flip/std", "runtime-common/std", ] runtime-benchmarks = [ @@ -151,21 +151,21 @@ runtime-benchmarks = [ "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system-benchmarking", - "system/runtime-benchmarks", + "frame-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "balances/runtime-benchmarks", - "collective/runtime-benchmarks", - "democracy/runtime-benchmarks", - "elections-phragmen/runtime-benchmarks", - "identity/runtime-benchmarks", - "im-online/runtime-benchmarks", - "scheduler/runtime-benchmarks", - "society/runtime-benchmarks", - "staking/runtime-benchmarks", - "timestamp/runtime-benchmarks", - "treasury/runtime-benchmarks", - "utility/runtime-benchmarks", - "vesting/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-society/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-vesting/runtime-benchmarks", "pallet-offences-benchmarking", "pallet-session-benchmarking", "hex-literal", diff --git a/runtime/kusama/src/constants.rs b/runtime/kusama/src/constants.rs index 560d83347d9b..5d81cf0bb853 100644 --- a/runtime/kusama/src/constants.rs +++ b/runtime/kusama/src/constants.rs @@ -69,7 +69,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, system::MaximumBlockWeight] + /// - [0, frame_system::MaximumBlockWeight] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 0780de62c4eb..e2f9b03a04d1 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -47,10 +47,10 @@ use sp_runtime::{ }; #[cfg(feature = "runtime-benchmarks")] use sp_runtime::RuntimeString; -use version::RuntimeVersion; -use grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_version::RuntimeVersion; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; #[cfg(any(feature = "std", test))] -use version::NativeVersion; +use sp_version::NativeVersion; use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; use frame_support::{ @@ -58,19 +58,19 @@ use frame_support::{ traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier, Filter, InstanceFilter}, weights::Weight, }; -use system::{EnsureRoot, EnsureOneOf}; -use im_online::sr25519::AuthorityId as ImOnlineId; +use frame_system::{EnsureRoot, EnsureOneOf}; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use session::{historical as session_historical}; +use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; +use pallet_session::{historical as session_historical}; use static_assertions::const_assert; #[cfg(feature = "std")] -pub use staking::StakerStatus; +pub use pallet_staking::StakerStatus; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use timestamp::Call as TimestampCall; -pub use balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +pub use pallet_balances::Call as BalancesCall; pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER}; pub use parachains::Call as ParachainsCall; @@ -95,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] - apis: version::create_apis_vec![[]], + apis: sp_version::create_apis_vec![[]], transaction_version: 2, }; @@ -119,14 +119,14 @@ impl Filter for BaseFilter { type MoreThanHalfCouncil = EnsureOneOf< AccountId, EnsureRoot, - collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> + pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> >; parameter_types! { pub const Version: RuntimeVersion = VERSION; } -impl system::Trait for Runtime { +impl frame_system::Trait for Runtime { type BaseCallFilter = BaseFilter; type Origin = Origin; type Call = Call; @@ -148,13 +148,13 @@ impl system::Trait for Runtime { type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type ModuleToIndex = ModuleToIndex; - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } -impl scheduler::Trait for Runtime { +impl pallet_scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; type PalletsOrigin = OriginCaller; @@ -169,34 +169,34 @@ parameter_types! { pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; } -impl babe::Trait for Runtime { +impl pallet_babe::Trait for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = Historical; type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = - babe::EquivocationHandler; + pallet_babe::EquivocationHandler; } parameter_types! { pub const IndexDeposit: Balance = 1 * DOLLARS; } -impl indices::Trait for Runtime { +impl pallet_indices::Trait for Runtime { type AccountIndex = AccountIndex; type Currency = Balances; type Deposit = IndexDeposit; @@ -216,20 +216,20 @@ pub type DealWithFees = SplitTwoWays< _1, ToAuthor, // 1 part (20%) goes to the block author. >; -impl balances::Trait for Runtime { +impl pallet_balances::Trait for Runtime { type Balance = Balance; type DustRemoval = (); type Event = Event; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = weights::balances::WeightInfo; + type WeightInfo = weights::pallet_balances::WeightInfo; } parameter_types! { pub const TransactionByteFee: Balance = 10 * MILLICENTS; } -impl transaction_payment::Trait for Runtime { +impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = DealWithFees; type TransactionByteFee = TransactionByteFee; @@ -240,7 +240,7 @@ impl transaction_payment::Trait for Runtime { parameter_types! { pub const MinimumPeriod: u64 = SLOT_DURATION / 2; } -impl timestamp::Trait for Runtime { +impl pallet_timestamp::Trait for Runtime { type Moment = u64; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; @@ -252,8 +252,8 @@ parameter_types! { } // TODO: substrate#2986 implement this properly -impl authorship::Trait for Runtime { - type FindAuthor = session::FindAccountFromAuthorIndex; +impl pallet_authorship::Trait for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; type FilterUncle = (); type EventHandler = (Staking, ImOnline); @@ -278,22 +278,22 @@ parameter_types! { pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); } -impl session::Trait for Runtime { +impl pallet_session::Trait for Runtime { type Event = Event; type ValidatorId = AccountId; - type ValidatorIdOf = staking::StashOf; + type ValidatorIdOf = pallet_staking::StashOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - type SessionManager = session::historical::NoteHistoricalRoot; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; type WeightInfo = (); } -impl session::historical::Trait for Runtime { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; +impl pallet_session::historical::Trait for Runtime { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } // TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and @@ -316,9 +316,9 @@ parameter_types! { // Six sessions in an era (6 hours). pub const SessionsPerEra: SessionIndex = 6; // 28 eras for unbonding (7 days). - pub const BondingDuration: staking::EraIndex = 28; + pub const BondingDuration: pallet_staking::EraIndex = 28; // 27 eras in which slashes can be cancelled (slightly less than 7 days). - pub const SlashDeferDuration: staking::EraIndex = 27; + pub const SlashDeferDuration: pallet_staking::EraIndex = 27; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; // quarter of the last session will be for election. @@ -330,10 +330,10 @@ parameter_types! { type SlashCancelOrigin = EnsureOneOf< AccountId, EnsureRoot, - collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> + pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective> >; -impl staking::Trait for Runtime { +impl pallet_staking::Trait for Runtime { type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = CurrencyToVoteHandler; @@ -371,7 +371,7 @@ parameter_types! { pub const MaxVotes: u32 = 100; } -impl democracy::Trait for Runtime { +impl pallet_democracy::Trait for Runtime { type Proposal = Call; type Event = Event; type Currency = Balances; @@ -380,30 +380,30 @@ impl democracy::Trait for Runtime { type VotingPeriod = VotingPeriod; type MinimumDeposit = MinimumDeposit; /// A straight majority of the council can decide what their next motion is. - type ExternalOrigin = collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + type ExternalOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; /// A majority can have the next scheduled referendum be a straight majority-carries vote. - type ExternalMajorityOrigin = collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; + type ExternalMajorityOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>; /// A unanimous council can have the next scheduled referendum be a straight default-carries /// (NTB) vote. - type ExternalDefaultOrigin = collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; + type ExternalDefaultOrigin = pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>; /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote /// be tabled immediately and with a shorter voting/enactment period. - type FastTrackOrigin = collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; - type InstantOrigin = collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; + type FastTrackOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>; + type InstantOrigin = pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>; type InstantAllowed = InstantAllowed; type FastTrackVotingPeriod = FastTrackVotingPeriod; // To cancel a proposal which has been passed, 2/3 of the council must agree to it. - type CancellationOrigin = collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; + type CancellationOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>; // Any single technical committee member may veto a coming council proposal, however they can // only do it once and it lasts only for the cooloff period. - type VetoOrigin = collective::EnsureMember; + type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; type PreimageByteDeposit = PreimageByteDeposit; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; - type OperationalPreimageOrigin = collective::EnsureMember; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type WeightInfo = (); } @@ -412,8 +412,8 @@ parameter_types! { pub const CouncilMaxProposals: u32 = 100; } -type CouncilCollective = collective::Instance1; -impl collective::Trait for Runtime { +type CouncilCollective = pallet_collective::Instance1; +impl pallet_collective::Trait for Runtime { type Origin = Origin; type Proposal = Call; type Event = Event; @@ -432,9 +432,9 @@ parameter_types! { pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; } // Make sure that there are no more than MAX_MEMBERS members elected via phragmen. -const_assert!(DesiredMembers::get() <= collective::MAX_MEMBERS); +const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS); -impl elections_phragmen::Trait for Runtime { +impl pallet_elections_phragmen::Trait for Runtime { type Event = Event; type Currency = Balances; type ChangeMembers = Council; @@ -457,8 +457,8 @@ parameter_types! { pub const TechnicalMaxProposals: u32 = 100; } -type TechnicalCollective = collective::Instance2; -impl collective::Trait for Runtime { +type TechnicalCollective = pallet_collective::Instance2; +impl pallet_collective::Trait for Runtime { type Origin = Origin; type Proposal = Call; type Event = Event; @@ -467,7 +467,7 @@ impl collective::Trait for Runtime { type WeightInfo = (); } -impl membership::Trait for Runtime { +impl pallet_membership::Trait for Runtime { type Event = Event; type AddOrigin = MoreThanHalfCouncil; type RemoveOrigin = MoreThanHalfCouncil; @@ -494,10 +494,10 @@ parameter_types! { type ApproveOrigin = EnsureOneOf< AccountId, EnsureRoot, - collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> + pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> >; -impl treasury::Trait for Runtime { +impl pallet_treasury::Trait for Runtime { type Currency = Balances; type ApproveOrigin = ApproveOrigin; type RejectOrigin = MoreThanHalfCouncil; @@ -521,15 +521,15 @@ parameter_types! { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } -impl offences::Trait for Runtime { +impl pallet_offences::Trait for Runtime { type Event = Event; - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); } -impl authority_discovery::Trait for Runtime {} +impl pallet_authority_discovery::Trait for Runtime {} parameter_types! { pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_BLOCKS as _; @@ -540,7 +540,7 @@ parameter_types! { pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); } -impl im_online::Trait for Runtime { +impl pallet_im_online::Trait for Runtime { type AuthorityId = ImOnlineId; type Event = Event; type ReportUnresponsiveness = Offences; @@ -549,7 +549,7 @@ impl im_online::Trait for Runtime { type WeightInfo = (); } -impl grandpa::Trait for Runtime { +impl pallet_grandpa::Trait for Runtime { type Event = Event; type Call = Call; @@ -563,15 +563,15 @@ impl grandpa::Trait for Runtime { GrandpaId, )>>::IdentificationTuple; - type HandleEquivocation = grandpa::EquivocationHandler; + type HandleEquivocation = pallet_grandpa::EquivocationHandler; } parameter_types! { - pub WindowSize: BlockNumber = finality_tracker::DEFAULT_WINDOW_SIZE.into(); - pub ReportLatency: BlockNumber = finality_tracker::DEFAULT_REPORT_LATENCY.into(); + pub WindowSize: BlockNumber = pallet_finality_tracker::DEFAULT_WINDOW_SIZE.into(); + pub ReportLatency: BlockNumber = pallet_finality_tracker::DEFAULT_REPORT_LATENCY.into(); } -impl finality_tracker::Trait for Runtime { +impl pallet_finality_tracker::Trait for Runtime { type OnFinalizationStalled = (); type WindowSize = WindowSize; type ReportLatency = ReportLatency; @@ -612,7 +612,7 @@ impl parachains::Trait for Runtime { type SlashPeriod = SlashPeriod; type Proof = sp_session::MembershipProof; - type KeyOwnerProofSystem = session::historical::Module; + type KeyOwnerProofSystem = pallet_session::historical::Module; type IdentificationTuple = )>>::IdentificationTuple; type ReportOffence = Offences; type BlockHashConversion = sp_runtime::traits::Identity; @@ -620,14 +620,14 @@ impl parachains::Trait for Runtime { /// Submits transaction with the node's public and signature type. Adheres to the signed extension /// format of the chain. -impl system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, public: ::Signer, account: AccountId, - nonce: ::Index, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { // take the biggest period possible. let period = BlockHashCount::get() @@ -642,13 +642,13 @@ impl system::offchain::CreateSignedTransaction for Runtime .saturating_sub(1); let tip = 0; let extra: SignedExtra = ( - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - transaction_payment::ChargeTransactionPayment::::from(tip), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), registrar::LimitParathreadCommits::::new(), parachains::ValidateDoubleVoteReports::::new(), ); @@ -663,12 +663,12 @@ impl system::offchain::CreateSignedTransaction for Runtime } } -impl system::offchain::SigningTypes for Runtime { +impl frame_system::offchain::SigningTypes for Runtime { type Public = ::Signer; type Signature = Signature; } -impl system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From, { type OverarchingCall = Call; @@ -713,7 +713,7 @@ impl claims::Trait for Runtime { type Event = Event; type VestingSchedule = Vesting; type Prefix = Prefix; - type MoveClaimOrigin = collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; + type MoveClaimOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; } parameter_types! { @@ -726,7 +726,7 @@ parameter_types! { pub const MaxRegistrars: u32 = 20; } -impl identity::Trait for Runtime { +impl pallet_identity::Trait for Runtime { type Event = Event; type Currency = Balances; type Slashed = Treasury; @@ -741,7 +741,7 @@ impl identity::Trait for Runtime { type WeightInfo = (); } -impl utility::Trait for Runtime { +impl pallet_utility::Trait for Runtime { type Event = Event; type Call = Call; type WeightInfo = (); @@ -755,7 +755,7 @@ parameter_types! { pub const MaxSignatories: u16 = 100; } -impl multisig::Trait for Runtime { +impl pallet_multisig::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -772,7 +772,7 @@ parameter_types! { pub const RecoveryDeposit: Balance = 5 * DOLLARS; } -impl recovery::Trait for Runtime { +impl pallet_recovery::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -793,7 +793,7 @@ parameter_types! { pub const SocietyModuleId: ModuleId = ModuleId(*b"py/socie"); } -impl society::Trait for Runtime { +impl pallet_society::Trait for Runtime { type Event = Event; type Currency = Balances; type Randomness = RandomnessCollectiveFlip; @@ -804,8 +804,8 @@ impl society::Trait for Runtime { type MembershipChanged = (); type RotationPeriod = RotationPeriod; type MaxLockDuration = MaxLockDuration; - type FounderSetOrigin = collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; - type SuspensionJudgementOrigin = society::EnsureFounder; + type FounderSetOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>; + type SuspensionJudgementOrigin = pallet_society::EnsureFounder; type ChallengePeriod = ChallengePeriod; type ModuleId = SocietyModuleId; } @@ -814,7 +814,7 @@ parameter_types! { pub const MinVestedTransfer: Balance = 100 * DOLLARS; } -impl vesting::Trait for Runtime { +impl pallet_vesting::Trait for Runtime { type Event = Event; type Currency = Balances; type BlockNumberToBalance = ConvertInto; @@ -848,9 +848,9 @@ impl InstanceFilter for ProxyType { Call::System(..) | Call::Babe(..) | Call::Timestamp(..) | - Call::Indices(indices::Call::claim(..)) | - Call::Indices(indices::Call::free(..)) | - Call::Indices(indices::Call::freeze(..)) | + Call::Indices(pallet_indices::Call::claim(..)) | + Call::Indices(pallet_indices::Call::free(..)) | + Call::Indices(pallet_indices::Call::freeze(..)) | // Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting the entire Balances pallet Call::Authorship(..) | @@ -875,15 +875,15 @@ impl InstanceFilter for ProxyType { Call::Utility(..) | Call::Identity(..) | Call::Society(..) | - Call::Recovery(recovery::Call::as_recovered(..)) | - Call::Recovery(recovery::Call::vouch_recovery(..)) | - Call::Recovery(recovery::Call::claim_recovery(..)) | - Call::Recovery(recovery::Call::close_recovery(..)) | - Call::Recovery(recovery::Call::remove_recovery(..)) | - Call::Recovery(recovery::Call::cancel_recovered(..)) | + Call::Recovery(pallet_recovery::Call::as_recovered(..)) | + Call::Recovery(pallet_recovery::Call::vouch_recovery(..)) | + Call::Recovery(pallet_recovery::Call::claim_recovery(..)) | + Call::Recovery(pallet_recovery::Call::close_recovery(..)) | + Call::Recovery(pallet_recovery::Call::remove_recovery(..)) | + Call::Recovery(pallet_recovery::Call::cancel_recovered(..)) | // Specifically omitting Recovery `create_recovery`, `initiate_recovery` - Call::Vesting(vesting::Call::vest(..)) | - Call::Vesting(vesting::Call::vest_other(..)) | + Call::Vesting(pallet_vesting::Call::vest(..)) | + Call::Vesting(pallet_vesting::Call::vest_other(..)) | // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` Call::Scheduler(..) | Call::Proxy(..) | @@ -897,8 +897,8 @@ impl InstanceFilter for ProxyType { Call::Staking(..) | Call::Utility(..) ), ProxyType::IdentityJudgement => matches!(c, - Call::Identity(identity::Call::provide_judgement(..)) - | Call::Utility(utility::Call::batch(..)) + Call::Identity(pallet_identity::Call::provide_judgement(..)) + | Call::Utility(pallet_utility::Call::batch(..)) ) } } @@ -913,7 +913,7 @@ impl InstanceFilter for ProxyType { } } -impl proxy::Trait for Runtime { +impl pallet_proxy::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -927,10 +927,10 @@ impl proxy::Trait for Runtime { pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { - if scheduler::Module::::migrate_v1_to_t2() { - ::MaximumBlockWeight::get() + if pallet_scheduler::Module::::migrate_v1_to_t2() { + ::MaximumBlockWeight::get() } else { - ::DbWeight::get().reads(1) + 500_000_000 + ::DbWeight::get().reads(1) + 500_000_000 } } } @@ -942,35 +942,35 @@ construct_runtime! { UncheckedExtrinsic = UncheckedExtrinsic { // Basic stuff; balances is uncallable initially. - System: system::{Module, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage}, + System: frame_system::{Module, Call, Storage, Config, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage}, // Must be before session. - Babe: babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, - Timestamp: timestamp::{Module, Call, Storage, Inherent}, - Indices: indices::{Module, Call, Storage, Config, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - TransactionPayment: transaction_payment::{Module, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, + Indices: pallet_indices::{Module, Call, Storage, Config, Event}, + Balances: pallet_balances::{Module, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Module, Storage}, // Consensus support. - Authorship: authorship::{Module, Call, Storage}, - Staking: staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - Offences: offences::{Module, Call, Storage, Event}, + Authorship: pallet_authorship::{Module, Call, Storage}, + Staking: pallet_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + Offences: pallet_offences::{Module, Call, Storage, Event}, Historical: session_historical::{Module}, - Session: session::{Module, Call, Storage, Event, Config}, - FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent}, - Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, - AuthorityDiscovery: authority_discovery::{Module, Call, Config}, + Session: pallet_session::{Module, Call, Storage, Event, Config}, + FinalityTracker: pallet_finality_tracker::{Module, Call, Storage, Inherent}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, // Governance stuff; uncallable initially. - Democracy: democracy::{Module, Call, Storage, Config, Event}, - Council: collective::::{Module, Call, Storage, Origin, Event, Config}, - TechnicalCommittee: collective::::{Module, Call, Storage, Origin, Event, Config}, - ElectionsPhragmen: elections_phragmen::{Module, Call, Storage, Event, Config}, - TechnicalMembership: membership::::{Module, Call, Storage, Event, Config}, - Treasury: treasury::{Module, Call, Storage, Event}, + Democracy: pallet_democracy::{Module, Call, Storage, Config, Event}, + Council: pallet_collective::::{Module, Call, Storage, Origin, Event, Config}, + TechnicalCommittee: pallet_collective::::{Module, Call, Storage, Origin, Event, Config}, + ElectionsPhragmen: pallet_elections_phragmen::{Module, Call, Storage, Event, Config}, + TechnicalMembership: pallet_membership::::{Module, Call, Storage, Event, Config}, + Treasury: pallet_treasury::{Module, Call, Storage, Event}, // Claims. Usable initially. Claims: claims::{Module, Call, Storage, Event, Config, ValidateUnsigned}, @@ -983,28 +983,28 @@ construct_runtime! { Registrar: registrar::{Module, Call, Storage, Event, Config}, // Utility module. - Utility: utility::{Module, Call, Event}, + Utility: pallet_utility::{Module, Call, Event}, // Less simple identity module. - Identity: identity::{Module, Call, Storage, Event}, + Identity: pallet_identity::{Module, Call, Storage, Event}, // Society module. - Society: society::{Module, Call, Storage, Event}, + Society: pallet_society::{Module, Call, Storage, Event}, // Social recovery module. - Recovery: recovery::{Module, Call, Storage, Event}, + Recovery: pallet_recovery::{Module, Call, Storage, Event}, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: vesting::{Module, Call, Storage, Event, Config}, + Vesting: pallet_vesting::{Module, Call, Storage, Event, Config}, // System scheduler. - Scheduler: scheduler::{Module, Call, Storage, Event}, + Scheduler: pallet_scheduler::{Module, Call, Storage, Event}, // Proxy module. Late addition. - Proxy: proxy::{Module, Call, Storage, Event}, + Proxy: pallet_proxy::{Module, Call, Storage, Event}, // Multisig module. Late addition. - Multisig: multisig::{Module, Call, Storage, Event}, + Multisig: pallet_multisig::{Module, Call, Storage, Event}, } } @@ -1020,13 +1020,13 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckMortality, - system::CheckNonce, - system::CheckWeight, - transaction_payment::ChargeTransactionPayment, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckMortality, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, registrar::LimitParathreadCommits, parachains::ValidateDoubleVoteReports, ); @@ -1035,10 +1035,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive< +pub type Executive = frame_executive::Executive< Runtime, Block, - system::ChainContext, + frame_system::ChainContext, Runtime, AllModules, CustomOnRuntimeUpgrade @@ -1245,13 +1245,13 @@ sp_api::impl_runtime_apis! { } } - impl system_rpc_runtime_api::AccountNonceApi for Runtime { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } - impl transaction_payment_rpc_runtime_api::TransactionPaymentApi< + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, > for Runtime { @@ -1315,21 +1315,21 @@ sp_api::impl_runtime_apis! { // Polkadot add_benchmark!(params, batches, claims, Claims); // Substrate - add_benchmark!(params, batches, balances, Balances); - add_benchmark!(params, batches, collective, Council); - add_benchmark!(params, batches, democracy, Democracy); - add_benchmark!(params, batches, elections_phragmen, ElectionsPhragmen); - add_benchmark!(params, batches, identity, Identity); - add_benchmark!(params, batches, im_online, ImOnline); - add_benchmark!(params, batches, offences, OffencesBench::); - add_benchmark!(params, batches, scheduler, Scheduler); - add_benchmark!(params, batches, session, SessionBench::); - add_benchmark!(params, batches, staking, Staking); - add_benchmark!(params, batches, system, SystemBench::); - add_benchmark!(params, batches, timestamp, Timestamp); - add_benchmark!(params, batches, treasury, Treasury); - add_benchmark!(params, batches, utility, Utility); - add_benchmark!(params, batches, vesting, Vesting); + add_benchmark!(params, batches, pallet_balances, Balances); + add_benchmark!(params, batches, pallet_collective, Council); + add_benchmark!(params, batches, pallet_democracy, Democracy); + add_benchmark!(params, batches, pallet_elections_phragmen, ElectionsPhragmen); + add_benchmark!(params, batches, pallet_identity, Identity); + add_benchmark!(params, batches, pallet_im_online, ImOnline); + add_benchmark!(params, batches, pallet_offences, OffencesBench::); + add_benchmark!(params, batches, pallet_scheduler, Scheduler); + add_benchmark!(params, batches, pallet_session, SessionBench::); + add_benchmark!(params, batches, pallet_staking, Staking); + add_benchmark!(params, batches, frame_system, SystemBench::); + add_benchmark!(params, batches, pallet_timestamp, Timestamp); + add_benchmark!(params, batches, pallet_treasury, Treasury); + add_benchmark!(params, batches, pallet_utility, Utility); + add_benchmark!(params, batches, pallet_vesting, Vesting); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/kusama/src/weights/mod.rs b/runtime/kusama/src/weights/mod.rs index 75cabca0c6e6..b94314e33942 100644 --- a/runtime/kusama/src/weights/mod.rs +++ b/runtime/kusama/src/weights/mod.rs @@ -16,4 +16,4 @@ /// A collection of weight modules used for pallets in the runtime. -pub mod balances; +pub mod pallet_balances; diff --git a/runtime/kusama/src/weights/balances.rs b/runtime/kusama/src/weights/pallet_balances.rs similarity index 97% rename from runtime/kusama/src/weights/balances.rs rename to runtime/kusama/src/weights/pallet_balances.rs index bc2f3ac18af2..53431ba48f2f 100644 --- a/runtime/kusama/src/weights/balances.rs +++ b/runtime/kusama/src/weights/pallet_balances.rs @@ -18,7 +18,7 @@ use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight}; pub struct WeightInfo; -impl balances::WeightInfo for WeightInfo { +impl pallet_balances::WeightInfo for WeightInfo { fn transfer() -> Weight { (65949000 as Weight) .saturating_add(DbWeight::get().reads(1 as Weight)) diff --git a/runtime/parachains/Cargo.toml b/runtime/parachains/Cargo.toml index ec3f2712bf9e..a2aef4d65cb1 100644 --- a/runtime/parachains/Cargo.toml +++ b/runtime/parachains/Cargo.toml @@ -21,15 +21,15 @@ sp-session = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } @@ -42,11 +42,11 @@ rand_chacha = { version = "0.2.2", default-features = false } hex-literal = "0.2.1" keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" } -treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master" } serde_json = "1.0.41" libsecp256k1 = "0.3.2" sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -69,20 +69,20 @@ std = [ "sp-std/std", "sp-io/std", "frame-support/std", - "authorship/std", - "balances/std", + "pallet-authorship/std", + "pallet-balances/std", "sp-runtime/std", "sp-session/std", "sp-staking/std", - "session/std", - "staking/std", - "system/std", - "timestamp/std", - "vesting/std", + "pallet-session/std", + "pallet-staking/std", + "frame-system/std", + "pallet-timestamp/std", + "pallet-vesting/std", ] runtime-benchmarks = [ "libsecp256k1/hmac", "frame-benchmarking", "frame-support/runtime-benchmarks", - "system/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index 6fc9dd4230b2..ae85e751bf53 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -27,7 +27,7 @@ use frame_support::{ }; use sp_runtime::traits::One; use codec::{Encode, Decode}; -use system::ensure_root; +use frame_system::ensure_root; /// All configuration of the runtime with respect to parachains and parathreads. #[derive(Clone, Encode, Decode, PartialEq, Default)] @@ -61,7 +61,7 @@ pub struct HostConfiguration { pub scheduling_lookahead: u32, } -pub trait Trait: system::Trait { } +pub trait Trait: frame_system::Trait { } decl_storage! { trait Store for Module as Configuration { @@ -78,7 +78,7 @@ decl_error! { decl_module! { /// The parachains configuration module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; /// Set the validation upgrade frequency. @@ -227,7 +227,7 @@ impl Module { GlobalValidationData { max_code_size: config.max_code_size, max_head_data_size: config.max_head_data_size, - block_number: >::block_number() - One::one(), + block_number: >::block_number() - One::one(), } } } diff --git a/runtime/parachains/src/inclusion.rs b/runtime/parachains/src/inclusion.rs index e6f5ff1a0a53..07d2df50d1ef 100644 --- a/runtime/parachains/src/inclusion.rs +++ b/runtime/parachains/src/inclusion.rs @@ -87,9 +87,9 @@ impl CandidatePendingAvailability { } pub trait Trait: - system::Trait + paras::Trait + configuration::Trait + frame_system::Trait + paras::Trait + configuration::Trait { - type Event: From> + Into<::Event>; + type Event: From> + Into<::Event>; } decl_storage! { @@ -154,7 +154,7 @@ decl_error! { } decl_event! { - pub enum Event where ::Hash { + pub enum Event where ::Hash { /// A candidate was backed. CandidateBacked(CandidateReceipt, HeadData), /// A candidate was included. @@ -167,7 +167,7 @@ decl_event! { decl_module! { /// The parachain-candidate inclusion module. pub struct Module - for enum Call where origin: ::Origin, system = system + for enum Call where origin: ::Origin { type Error = Error; @@ -230,7 +230,7 @@ impl Module { let mut last_index = None; let signing_context = SigningContext { - parent_hash: >::parent_hash(), + parent_hash: >::parent_hash(), session_index, }; @@ -266,7 +266,7 @@ impl Module { } } - let now = >::block_number(); + let now = >::block_number(); for signed_bitfield in signed_bitfields { for (bit_idx, _) in signed_bitfield.payload().0.iter().enumerate().filter(|(_, is_av)| **is_av) @@ -356,9 +356,9 @@ impl Module { } let validators = Validators::get(); - let parent_hash = >::parent_hash(); + let parent_hash = >::parent_hash(); let config = >::config(); - let now = >::block_number(); + let now = >::block_number(); let relay_parent_number = now - One::one(); // do all checks before writing storage. diff --git a/runtime/parachains/src/inclusion_inherent.rs b/runtime/parachains/src/inclusion_inherent.rs index 6d06961b461a..f9a7465d9128 100644 --- a/runtime/parachains/src/inclusion_inherent.rs +++ b/runtime/parachains/src/inclusion_inherent.rs @@ -31,7 +31,7 @@ use frame_support::{ weights::{DispatchClass, Weight}, traits::Get, }; -use system::ensure_none; +use frame_system::ensure_none; use crate::{ inclusion, scheduler::{self, FreedReason}, @@ -61,7 +61,7 @@ decl_error! { decl_module! { /// The inclusion inherent module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; fn on_initialize() -> Weight { @@ -134,7 +134,7 @@ impl ProvideInherent for Module { .map(|(signed_bitfields, backed_candidates): (SignedAvailabilityBitfields, Vec>)| { // Sanity check: session changes can invalidate an inherent, and we _really_ don't want that to happen. // See github.com/paritytech/polkadot/issues/1327 - if Self::inclusion(system::RawOrigin::None.into(), signed_bitfields.clone(), backed_candidates.clone()).is_ok() { + if Self::inclusion(frame_system::RawOrigin::None.into(), signed_bitfields.clone(), backed_candidates.clone()).is_ok() { Call::inclusion(signed_bitfields, backed_candidates) } else { Call::inclusion(Vec::new().into(), Vec::new()) diff --git a/runtime/parachains/src/initializer.rs b/runtime/parachains/src/initializer.rs index 0c4f83cccea1..11481e7ffdf0 100644 --- a/runtime/parachains/src/initializer.rs +++ b/runtime/parachains/src/initializer.rs @@ -55,7 +55,7 @@ struct BufferedSessionChange { } pub trait Trait: - system::Trait + configuration::Trait + paras::Trait + scheduler::Trait + inclusion::Trait + frame_system::Trait + configuration::Trait + paras::Trait + scheduler::Trait + inclusion::Trait { /// A randomness beacon. type Randomness: Randomness; @@ -89,7 +89,7 @@ decl_error! { decl_module! { /// The initializer module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; fn on_initialize(now: T::BlockNumber) -> Weight { @@ -190,7 +190,7 @@ impl Module { }; >::mutate(|v| v.push(BufferedSessionChange { - apply_at: >::block_number() + One::one(), + apply_at: >::block_number() + One::one(), validators, queued, session_index, @@ -202,7 +202,7 @@ impl sp_runtime::BoundToRuntimeAppPublic for Module { type Public = ValidatorId; } -impl session::OneSessionHandler for Module { +impl pallet_session::OneSessionHandler for Module { type Key = ValidatorId; fn on_genesis_session<'a, I: 'a>(_validators: I) @@ -214,7 +214,7 @@ impl session::OneSessionHandler for Mod fn on_new_session<'a, I: 'a>(changed: bool, validators: I, queued: I) where I: Iterator { - let session_index = >::current_index(); + let session_index = >::current_index(); >::on_new_session(changed, session_index, validators, Some(queued)); } diff --git a/runtime/parachains/src/mock.rs b/runtime/parachains/src/mock.rs index 21ee83433d5d..7001b1c1df9c 100644 --- a/runtime/parachains/src/mock.rs +++ b/runtime/parachains/src/mock.rs @@ -36,7 +36,7 @@ use crate::inclusion; pub struct Test; impl_outer_origin! { - pub enum Origin for Test where system = system { } + pub enum Origin for Test { } } impl_outer_dispatch! { @@ -47,7 +47,7 @@ impl_outer_dispatch! { impl_outer_event! { pub enum TestEvent for Test { - system, + frame_system, inclusion, } } @@ -67,7 +67,7 @@ parameter_types! { pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75); } -impl system::Trait for Test { +impl frame_system::Trait for Test { type BaseCallFilter = (); type Origin = Origin; type Call = Call; @@ -89,7 +89,7 @@ impl system::Trait for Test { type AvailableBlockRatio = AvailableBlockRatio; type Version = (); type ModuleToIndex = (); - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); @@ -109,7 +109,7 @@ impl crate::inclusion::Trait for Test { type Event = TestEvent; } -pub type System = system::Module; +pub type System = frame_system::Module; /// Mocked initializer. pub type Initializer = crate::initializer::Module; @@ -137,7 +137,7 @@ pub fn new_test_ext(state: GenesisConfig) -> TestExternalities { #[derive(Default)] pub struct GenesisConfig { - pub system: system::GenesisConfig, + pub system: frame_system::GenesisConfig, pub configuration: crate::configuration::GenesisConfig, pub paras: crate::paras::GenesisConfig, } diff --git a/runtime/parachains/src/paras.rs b/runtime/parachains/src/paras.rs index 1f65bcd0c2ef..b1e48ca3ce62 100644 --- a/runtime/parachains/src/paras.rs +++ b/runtime/parachains/src/paras.rs @@ -41,7 +41,7 @@ use sp_core::RuntimeDebug; #[cfg(feature = "std")] use serde::{Serialize, Deserialize}; -pub trait Trait: system::Trait + configuration::Trait { } +pub trait Trait: frame_system::Trait + configuration::Trait { } // the two key times necessary to track for every code replacement. #[derive(Default, Encode, Decode)] @@ -241,7 +241,7 @@ decl_error! { decl_module! { /// The parachains configuration module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; } } @@ -257,7 +257,7 @@ impl Module { /// Called by the initializer to note that a new session has started. pub(crate) fn initializer_on_new_session(_notification: &SessionChangeNotification) { - let now = >::block_number(); + let now = >::block_number(); let mut parachains = Self::clean_up_outgoing(now); Self::apply_incoming(&mut parachains); ::Parachains::set(parachains); @@ -477,7 +477,7 @@ impl Module { CurrentCode::insert(&id, &new_code); // `now` is only used for registering pruning as part of `fn note_past_code` - let now = >::block_number(); + let now = >::block_number(); let weight = Self::note_past_code( id, @@ -509,7 +509,7 @@ impl Module { at: T::BlockNumber, assume_intermediate: Option, ) -> Option { - let now = >::block_number(); + let now = >::block_number(); let config = >::config(); if assume_intermediate.as_ref().map_or(false, |i| &at <= i) { @@ -553,7 +553,7 @@ impl Module { /// Compute the local-validation data based on the head of the para. This assumes the /// relay-parent is the parent of the current block. pub(crate) fn local_validation_data(para_id: ParaId) -> Option> { - let relay_parent_number = >::block_number() - One::one(); + let relay_parent_number = >::block_number() - One::one(); let config = >::config(); let freq = config.validation_upgrade_frequency; diff --git a/runtime/parachains/src/runtime_api_impl/v1.rs b/runtime/parachains/src/runtime_api_impl/v1.rs index a3bb6afff6f2..0a19e798f179 100644 --- a/runtime/parachains/src/runtime_api_impl/v1.rs +++ b/runtime/parachains/src/runtime_api_impl/v1.rs @@ -243,11 +243,11 @@ pub fn candidate_pending_availability(para_id: ParaId) pub fn candidate_events(extract_event: F) -> Vec> where T: initializer::Trait, - F: Fn(::Event) -> Option>, + F: Fn(::Event) -> Option>, { use inclusion::Event as RawEvent; - >::events().into_iter() + >::events().into_iter() .filter_map(|record| extract_event(record.event)) .map(|event| match event { RawEvent::::CandidateBacked(c, h) => CandidateEvent::CandidateBacked(c, h), diff --git a/runtime/parachains/src/scheduler.rs b/runtime/parachains/src/scheduler.rs index d664f0722502..a3ed466a2c2d 100644 --- a/runtime/parachains/src/scheduler.rs +++ b/runtime/parachains/src/scheduler.rs @@ -105,7 +105,7 @@ pub enum FreedReason { TimedOut, } -pub trait Trait: system::Trait + configuration::Trait + paras::Trait { } +pub trait Trait: frame_system::Trait + configuration::Trait + paras::Trait { } decl_storage! { trait Store for Module as ParaScheduler { @@ -147,7 +147,7 @@ decl_error! { decl_module! { /// The scheduler module. - pub struct Module for enum Call where origin: ::Origin, system = system { + pub struct Module for enum Call where origin: ::Origin { type Error = Error; } } @@ -195,7 +195,7 @@ impl Module { let n_parachains = >::parachains().len() as u32; let n_cores = n_parachains + config.parathread_cores; - >::set(>::block_number()); + >::set(>::block_number()); AvailabilityCores::mutate(|cores| { // clear all occupied cores. for maybe_occupied in cores.iter_mut() { @@ -355,7 +355,7 @@ impl Module { let parachains = >::parachains(); let mut scheduled = Scheduled::get(); let mut parathread_queue = ParathreadQueue::get(); - let now = >::block_number(); + let now = >::block_number(); if ValidatorGroups::get().is_empty() { return } @@ -548,7 +548,7 @@ impl Module { /// https://github.com/rust-lang/rust/issues/73226 /// which prevents us from testing the code if using `impl Trait`. pub(crate) fn availability_timeout_predicate() -> Option bool>> { - let now = >::block_number(); + let now = >::block_number(); let config = >::config(); let session_start = >::get(); @@ -596,7 +596,7 @@ impl Module { /// Returns a helper for determining group rotation. pub(crate) fn group_rotation_info() -> GroupRotationInfo { let session_start_block = Self::session_start_block(); - let now = >::block_number(); + let now = >::block_number(); let group_rotation_frequency = >::config() .group_rotation_frequency; @@ -1539,8 +1539,8 @@ mod tests { fn availability_predicate_no_rotation() { let genesis_config = MockGenesisConfig { configuration: crate::configuration::GenesisConfig { - config: HostConfiguration { - group_rotation_frequency: 0, // no rotation + config: HostConfiguration { + group_rotation_frequency: 0, // no rotation ..default_config() }, ..Default::default() @@ -1571,7 +1571,7 @@ mod tests { run_to_block(1, |number| match number { 1 => Some(SessionChangeNotification { new_config: HostConfiguration{ - // Note: the `group_rotation_frequency` config change + // Note: the `group_rotation_frequency` config change // is not accounted for on session change // group_rotation_frequency: 0, ..default_config() diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index cd1b5e14365b..42e679a87700 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -26,42 +26,42 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -version = { package = "sp-version", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authority-discovery = { package = "pallet-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -collective = { package = "pallet-collective", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -democracy = { package = "pallet-democracy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -membership = { package = "pallet-membership", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -multisig = { package = "pallet-multisig", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -proxy = { package = "pallet-proxy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -scheduler = { package = "pallet-scheduler", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-finality-tracker = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -utility = { package = "pallet-utility", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -90,7 +90,7 @@ no_std = [] only-staking = [] std = [ "authority-discovery-primitives/std", - "authority-discovery/std", + "pallet-authority-discovery/std", "bitvec/std", "primitives/std", "rustc-hex/std", @@ -103,62 +103,62 @@ std = [ "offchain-primitives/std", "sp-std/std", "frame-support/std", - "authorship/std", - "balances/std", - "transaction-payment/std", - "transaction-payment-rpc-runtime-api/std", - "collective/std", - "elections-phragmen/std", - "democracy/std", - "executive/std", - "finality-tracker/std", - "grandpa/std", - "identity/std", - "im-online/std", - "indices/std", - "membership/std", - "multisig/std", - "nicks/std", - "offences/std", - "proxy/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-collective/std", + "pallet-elections-phragmen/std", + "pallet-democracy/std", + "frame-executive/std", + "pallet-finality-tracker/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-indices/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-nicks/std", + "pallet-offences/std", + "pallet-proxy/std", "sp-runtime/std", "sp-staking/std", - "scheduler/std", - "session/std", - "staking/std", - "system/std", - "system_rpc_runtime_api/std", - "timestamp/std", - "treasury/std", - "version/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-staking/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "pallet-timestamp/std", + "pallet-treasury/std", + "sp-version/std", "serde_derive", "serde/std", "log", - "babe/std", + "pallet-babe/std", "babe-primitives/std", "sp-session/std", - "randomness-collective-flip/std", + "pallet-randomness-collective-flip/std", "runtime-common/std", - "vesting/std", - "utility/std", + "pallet-vesting/std", + "pallet-utility/std", ] runtime-benchmarks = [ "runtime-common/runtime-benchmarks", "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system-benchmarking", - "system/runtime-benchmarks", + "frame-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "balances/runtime-benchmarks", - "collective/runtime-benchmarks", - "democracy/runtime-benchmarks", - "elections-phragmen/runtime-benchmarks", - "im-online/runtime-benchmarks", - "scheduler/runtime-benchmarks", - "staking/runtime-benchmarks", - "timestamp/runtime-benchmarks", - "treasury/runtime-benchmarks", - "vesting/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-vesting/runtime-benchmarks", "pallet-offences-benchmarking", "pallet-session-benchmarking", # renable when optional diff --git a/runtime/polkadot/src/constants.rs b/runtime/polkadot/src/constants.rs index 8ad5478bcab8..f784e9fca1ac 100644 --- a/runtime/polkadot/src/constants.rs +++ b/runtime/polkadot/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, system::MaximumBlockWeight] + /// - [0, frame_system::MaximumBlockWeight] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 13de7985edf4..77b53f2563dc 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -44,10 +44,10 @@ use sp_runtime::{create_runtime_str, generic, impl_opaque_keys, ModuleId, ApplyE }}; #[cfg(feature = "runtime-benchmarks")] use sp_runtime::RuntimeString; -use version::RuntimeVersion; -use grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_version::RuntimeVersion; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; #[cfg(any(feature = "std", test))] -use version::NativeVersion; +use sp_version::NativeVersion; use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; use frame_support::{ @@ -55,19 +55,19 @@ use frame_support::{ traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier, Filter}, weights::Weight, }; -use system::{EnsureRoot, EnsureOneOf, EnsureSignedBy}; -use im_online::sr25519::AuthorityId as ImOnlineId; +use frame_system::{EnsureRoot, EnsureOneOf, EnsureSignedBy}; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use session::historical as session_historical; +use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; +use pallet_session::historical as session_historical; use static_assertions::const_assert; #[cfg(feature = "std")] -pub use staking::StakerStatus; +pub use pallet_staking::StakerStatus; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use timestamp::Call as TimestampCall; -pub use balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +pub use pallet_balances::Call as BalancesCall; pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER}; pub use parachains::Call as ParachainsCall; @@ -94,7 +94,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] - apis: version::create_apis_vec![[]], + apis: sp_version::create_apis_vec![[]], transaction_version: 4, }; @@ -136,14 +136,14 @@ impl Filter for BaseFilter { type MoreThanHalfCouncil = EnsureOneOf< AccountId, EnsureRoot, - collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> + pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective> >; parameter_types! { pub const Version: RuntimeVersion = VERSION; } -impl system::Trait for Runtime { +impl frame_system::Trait for Runtime { type BaseCallFilter = BaseFilter; type Origin = Origin; type Call = Call; @@ -165,13 +165,13 @@ impl system::Trait for Runtime { type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type ModuleToIndex = ModuleToIndex; - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } -impl scheduler::Trait for Runtime { +impl pallet_scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; type PalletsOrigin = OriginCaller; @@ -186,34 +186,34 @@ parameter_types! { pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; } -impl babe::Trait for Runtime { +impl pallet_babe::Trait for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = Historical; type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = - babe::EquivocationHandler; + pallet_babe::EquivocationHandler; } parameter_types! { pub const IndexDeposit: Balance = 10 * DOLLARS; } -impl indices::Trait for Runtime { +impl pallet_indices::Trait for Runtime { type AccountIndex = AccountIndex; type Currency = Balances; type Deposit = IndexDeposit; @@ -233,20 +233,20 @@ pub type DealWithFees = SplitTwoWays< _1, ToAuthor, // 1 part (20%) goes to the block author. >; -impl balances::Trait for Runtime { +impl pallet_balances::Trait for Runtime { type Balance = Balance; type DustRemoval = (); type Event = Event; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = weights::balances::WeightInfo; + type WeightInfo = weights::pallet_balances::WeightInfo; } parameter_types! { pub const TransactionByteFee: Balance = 10 * MILLICENTS; } -impl transaction_payment::Trait for Runtime { +impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = DealWithFees; type TransactionByteFee = TransactionByteFee; @@ -257,7 +257,7 @@ impl transaction_payment::Trait for Runtime { parameter_types! { pub const MinimumPeriod: u64 = SLOT_DURATION / 2; } -impl timestamp::Trait for Runtime { +impl pallet_timestamp::Trait for Runtime { type Moment = u64; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; @@ -269,8 +269,8 @@ parameter_types! { } // TODO: substrate#2986 implement this properly -impl authorship::Trait for Runtime { - type FindAuthor = session::FindAccountFromAuthorIndex; +impl pallet_authorship::Trait for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; type FilterUncle = (); type EventHandler = (Staking, ImOnline); @@ -290,22 +290,22 @@ parameter_types! { pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); } -impl session::Trait for Runtime { +impl pallet_session::Trait for Runtime { type Event = Event; type ValidatorId = AccountId; - type ValidatorIdOf = staking::StashOf; + type ValidatorIdOf = pallet_staking::StashOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - type SessionManager = session::historical::NoteHistoricalRoot; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; type WeightInfo = (); } -impl session::historical::Trait for Runtime { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; +impl pallet_session::historical::Trait for Runtime { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } // TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and @@ -328,8 +328,8 @@ parameter_types! { // Six sessions in an era (24 hours). pub const SessionsPerEra: SessionIndex = 6; // 28 eras for unbonding (28 days). - pub const BondingDuration: staking::EraIndex = 28; - pub const SlashDeferDuration: staking::EraIndex = 27; + pub const BondingDuration: pallet_staking::EraIndex = 28; + pub const SlashDeferDuration: pallet_staking::EraIndex = 27; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; // last 15 minutes of the last session will be for election. @@ -341,10 +341,10 @@ parameter_types! { type SlashCancelOrigin = EnsureOneOf< AccountId, EnsureRoot, - collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective> + pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective> >; -impl staking::Trait for Runtime { +impl pallet_staking::Trait for Runtime { type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = CurrencyToVoteHandler; @@ -379,7 +379,7 @@ parameter_types! { pub const MaxRegistrars: u32 = 20; } -impl identity::Trait for Runtime { +impl pallet_identity::Trait for Runtime { type Event = Event; type Currency = Balances; type BasicDeposit = BasicDeposit; @@ -407,7 +407,7 @@ parameter_types! { pub const MaxVotes: u32 = 100; } -impl democracy::Trait for Runtime { +impl pallet_democracy::Trait for Runtime { type Proposal = Call; type Event = Event; type Currency = Balances; @@ -416,44 +416,44 @@ impl democracy::Trait for Runtime { type VotingPeriod = VotingPeriod; type MinimumDeposit = MinimumDeposit; /// A straight majority of the council can decide what their next motion is. - type ExternalOrigin = system::EnsureOneOf, - system::EnsureRoot, + type ExternalOrigin = frame_system::EnsureOneOf, + frame_system::EnsureRoot, >; /// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote. - type ExternalMajorityOrigin = system::EnsureOneOf, - system::EnsureRoot, + type ExternalMajorityOrigin = frame_system::EnsureOneOf, + frame_system::EnsureRoot, >; /// A unanimous council can have the next scheduled referendum be a straight default-carries /// (NTB) vote. - type ExternalDefaultOrigin = system::EnsureOneOf, - system::EnsureRoot, + type ExternalDefaultOrigin = frame_system::EnsureOneOf, + frame_system::EnsureRoot, >; /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote /// be tabled immediately and with a shorter voting/enactment period. - type FastTrackOrigin = system::EnsureOneOf, - system::EnsureRoot, + type FastTrackOrigin = frame_system::EnsureOneOf, + frame_system::EnsureRoot, >; - type InstantOrigin = system::EnsureOneOf, - system::EnsureRoot, + type InstantOrigin = frame_system::EnsureOneOf, + frame_system::EnsureRoot, >; type InstantAllowed = InstantAllowed; type FastTrackVotingPeriod = FastTrackVotingPeriod; // To cancel a proposal which has been passed, 2/3 of the council must agree to it. - type CancellationOrigin = system::EnsureOneOf, - system::EnsureRoot, + type CancellationOrigin = frame_system::EnsureOneOf, + frame_system::EnsureRoot, >; // Any single technical committee member may veto a coming council proposal, however they can // only do it once and it lasts only for the cooloff period. - type VetoOrigin = collective::EnsureMember; + type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = collective::EnsureMember; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; @@ -466,8 +466,8 @@ parameter_types! { pub const CouncilMaxProposals: u32 = 100; } -type CouncilCollective = collective::Instance1; -impl collective::Trait for Runtime { +type CouncilCollective = pallet_collective::Instance1; +impl pallet_collective::Trait for Runtime { type Origin = Origin; type Proposal = Call; type Event = Event; @@ -487,9 +487,9 @@ parameter_types! { pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect"; } // Make sure that there are no more than MAX_MEMBERS members elected via phragmen. -const_assert!(DesiredMembers::get() <= collective::MAX_MEMBERS); +const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS); -impl elections_phragmen::Trait for Runtime { +impl pallet_elections_phragmen::Trait for Runtime { type Event = Event; type ModuleId = ElectionsPhragmenModuleId; type Currency = Balances; @@ -512,8 +512,8 @@ parameter_types! { pub const TechnicalMaxProposals: u32 = 100; } -type TechnicalCollective = collective::Instance2; -impl collective::Trait for Runtime { +type TechnicalCollective = pallet_collective::Instance2; +impl pallet_collective::Trait for Runtime { type Origin = Origin; type Proposal = Call; type Event = Event; @@ -522,7 +522,7 @@ impl collective::Trait for Runtime { type WeightInfo = (); } -impl membership::Trait for Runtime { +impl pallet_membership::Trait for Runtime { type Event = Event; type AddOrigin = MoreThanHalfCouncil; type RemoveOrigin = MoreThanHalfCouncil; @@ -549,10 +549,10 @@ parameter_types! { type ApproveOrigin = EnsureOneOf< AccountId, EnsureRoot, - collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> + pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective> >; -impl treasury::Trait for Runtime { +impl pallet_treasury::Trait for Runtime { type ModuleId = TreasuryModuleId; type Currency = Balances; type ApproveOrigin = ApproveOrigin; @@ -576,15 +576,15 @@ parameter_types! { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } -impl offences::Trait for Runtime { +impl pallet_offences::Trait for Runtime { type Event = Event; - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); } -impl authority_discovery::Trait for Runtime {} +impl pallet_authority_discovery::Trait for Runtime {} parameter_types! { pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_BLOCKS as _; @@ -595,7 +595,7 @@ parameter_types! { pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); } -impl im_online::Trait for Runtime { +impl pallet_im_online::Trait for Runtime { type AuthorityId = ImOnlineId; type Event = Event; type SessionDuration = SessionDuration; @@ -604,7 +604,7 @@ impl im_online::Trait for Runtime { type WeightInfo = (); } -impl grandpa::Trait for Runtime { +impl pallet_grandpa::Trait for Runtime { type Event = Event; type Call = Call; @@ -618,15 +618,15 @@ impl grandpa::Trait for Runtime { type KeyOwnerProofSystem = Historical; - type HandleEquivocation = grandpa::EquivocationHandler; + type HandleEquivocation = pallet_grandpa::EquivocationHandler; } parameter_types! { - pub WindowSize: BlockNumber = finality_tracker::DEFAULT_WINDOW_SIZE.into(); - pub ReportLatency: BlockNumber = finality_tracker::DEFAULT_REPORT_LATENCY.into(); + pub WindowSize: BlockNumber = pallet_finality_tracker::DEFAULT_WINDOW_SIZE.into(); + pub ReportLatency: BlockNumber = pallet_finality_tracker::DEFAULT_REPORT_LATENCY.into(); } -impl finality_tracker::Trait for Runtime { +impl pallet_finality_tracker::Trait for Runtime { type OnFinalizationStalled = (); type WindowSize = WindowSize; type ReportLatency = ReportLatency; @@ -668,7 +668,7 @@ impl parachains::Trait for Runtime { type SlashPeriod = SlashPeriod; type Proof = sp_session::MembershipProof; - type KeyOwnerProofSystem = session::historical::Module; + type KeyOwnerProofSystem = pallet_session::historical::Module; type IdentificationTuple = )>>::IdentificationTuple; type ReportOffence = Offences; type BlockHashConversion = sp_runtime::traits::Identity; @@ -676,14 +676,14 @@ impl parachains::Trait for Runtime { /// Submits a transaction with the node's public and signature type. Adheres to the signed extension /// format of the chain. -impl system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, public: ::Signer, account: AccountId, - nonce: ::Index, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { // take the biggest period possible. let period = BlockHashCount::get() @@ -698,13 +698,13 @@ impl system::offchain::CreateSignedTransaction for Runtime .saturating_sub(1); let tip = 0; let extra: SignedExtra = ( - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - transaction_payment::ChargeTransactionPayment::::from(tip), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), registrar::LimitParathreadCommits::::new(), parachains::ValidateDoubleVoteReports::::new(), claims::PrevalidateAttests::::new(), @@ -720,12 +720,12 @@ impl system::offchain::CreateSignedTransaction for Runtime } } -impl system::offchain::SigningTypes for Runtime { +impl frame_system::offchain::SigningTypes for Runtime { type Public = ::Signer; type Signature = Signature; } -impl system::offchain::SendTransactionTypes for Runtime where Call: From { +impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From { type Extrinsic = UncheckedExtrinsic; type OverarchingCall = Call; } @@ -769,14 +769,14 @@ impl claims::Trait for Runtime { type VestingSchedule = Vesting; type Prefix = Prefix; /// At least 3/4 of the council must agree to a claim move before it can happen. - type MoveClaimOrigin = collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>; + type MoveClaimOrigin = pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>; } parameter_types! { pub const MinVestedTransfer: Balance = 100 * DOLLARS; } -impl vesting::Trait for Runtime { +impl pallet_vesting::Trait for Runtime { type Event = Event; type Currency = Balances; type BlockNumberToBalance = ConvertInto; @@ -784,7 +784,7 @@ impl vesting::Trait for Runtime { type WeightInfo = (); } -impl utility::Trait for Runtime { +impl pallet_utility::Trait for Runtime { type Event = Event; type Call = Call; type WeightInfo = (); @@ -798,7 +798,7 @@ parameter_types! { pub const MaxSignatories: u16 = 100; } -impl multisig::Trait for Runtime { +impl pallet_multisig::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -866,9 +866,9 @@ impl InstanceFilter for ProxyType { Call::Scheduler(..) | Call::Babe(..) | Call::Timestamp(..) | - Call::Indices(indices::Call::claim(..)) | - Call::Indices(indices::Call::free(..)) | - Call::Indices(indices::Call::freeze(..)) | + Call::Indices(pallet_indices::Call::claim(..)) | + Call::Indices(pallet_indices::Call::free(..)) | + Call::Indices(pallet_indices::Call::freeze(..)) | // Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting the entire Balances pallet Call::Authorship(..) | @@ -890,8 +890,8 @@ impl InstanceFilter for ProxyType { Call::Slots(..) | Call::Registrar(..) | Call::Claims(..) | - Call::Vesting(vesting::Call::vest(..)) | - Call::Vesting(vesting::Call::vest_other(..)) | + Call::Vesting(pallet_vesting::Call::vest(..)) | + Call::Vesting(pallet_vesting::Call::vest_other(..)) | // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` Call::Utility(..) | Call::Identity(..) | @@ -903,11 +903,11 @@ impl InstanceFilter for ProxyType { | Call::ElectionsPhragmen(..) | Call::Treasury(..) | Call::Utility(..) ), ProxyType::Staking => matches!(c, - Call::Staking(..) | Call::Utility(utility::Call::batch(..)) | Call::Utility(..) + Call::Staking(..) | Call::Utility(pallet_utility::Call::batch(..)) | Call::Utility(..) ), ProxyType::IdentityJudgement => matches!(c, - Call::Identity(identity::Call::provide_judgement(..)) - | Call::Utility(utility::Call::batch(..)) + Call::Identity(pallet_identity::Call::provide_judgement(..)) + | Call::Utility(pallet_utility::Call::batch(..)) ) } } @@ -922,7 +922,7 @@ impl InstanceFilter for ProxyType { } } -impl proxy::Trait for Runtime { +impl pallet_proxy::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -937,7 +937,7 @@ pub struct CustomOnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn on_runtime_upgrade() -> frame_support::weights::Weight { use frame_support::storage::{StorageMap, IterableStorageMap}; - use democracy::{VotingOf, Conviction, Voting::Direct, AccountVote::Standard}; + use pallet_democracy::{VotingOf, Conviction, Voting::Direct, AccountVote::Standard}; // Cancel convictions for Referendum Zero (for removing Sudo - this is something we would // have done anyway). for (who, mut voting) in VotingOf::::iter() { @@ -949,7 +949,7 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { VotingOf::::insert(who, voting); } - ::MaximumBlockWeight::get() + ::MaximumBlockWeight::get() } } @@ -957,9 +957,9 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade { fn test_rm_ref_0() { use sp_runtime::AccountId32; use frame_support::{traits::OnRuntimeUpgrade, storage::StorageMap}; - use democracy::{VotingOf, Vote, Voting::{Direct, Delegating}, AccountVote::{Standard, Split}}; - use democracy::Conviction::{Locked1x, Locked2x, Locked3x, None as NoConviction}; - let t = system::GenesisConfig::default().build_storage::().unwrap(); + use pallet_democracy::{VotingOf, Vote, Voting::{Direct, Delegating}, AccountVote::{Standard, Split}}; + use pallet_democracy::Conviction::{Locked1x, Locked2x, Locked3x, None as NoConviction}; + let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { let a = |i| AccountId32::from([i; 32]); @@ -1087,36 +1087,36 @@ construct_runtime! { UncheckedExtrinsic = UncheckedExtrinsic { // Basic stuff; balances is uncallable initially. - System: system::{Module, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage}, - Scheduler: scheduler::{Module, Call, Storage, Event}, + System: frame_system::{Module, Call, Storage, Config, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage}, + Scheduler: pallet_scheduler::{Module, Call, Storage, Event}, // Must be before session. - Babe: babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, - Timestamp: timestamp::{Module, Call, Storage, Inherent}, - Indices: indices::{Module, Call, Storage, Config, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - TransactionPayment: transaction_payment::{Module, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, + Indices: pallet_indices::{Module, Call, Storage, Config, Event}, + Balances: pallet_balances::{Module, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Module, Storage}, // Consensus support. - Authorship: authorship::{Module, Call, Storage}, - Staking: staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - Offences: offences::{Module, Call, Storage, Event}, + Authorship: pallet_authorship::{Module, Call, Storage}, + Staking: pallet_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + Offences: pallet_offences::{Module, Call, Storage, Event}, Historical: session_historical::{Module}, - Session: session::{Module, Call, Storage, Event, Config}, - FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent}, - Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, - AuthorityDiscovery: authority_discovery::{Module, Call, Config}, + Session: pallet_session::{Module, Call, Storage, Event, Config}, + FinalityTracker: pallet_finality_tracker::{Module, Call, Storage, Inherent}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, // Governance stuff. - Democracy: democracy::{Module, Call, Storage, Config, Event}, - Council: collective::::{Module, Call, Storage, Origin, Event, Config}, - TechnicalCommittee: collective::::{Module, Call, Storage, Origin, Event, Config}, - ElectionsPhragmen: elections_phragmen::{Module, Call, Storage, Event, Config}, - TechnicalMembership: membership::::{Module, Call, Storage, Event, Config}, - Treasury: treasury::{Module, Call, Storage, Event}, + Democracy: pallet_democracy::{Module, Call, Storage, Config, Event}, + Council: pallet_collective::::{Module, Call, Storage, Origin, Event, Config}, + TechnicalCommittee: pallet_collective::::{Module, Call, Storage, Origin, Event, Config}, + ElectionsPhragmen: pallet_elections_phragmen::{Module, Call, Storage, Event, Config}, + TechnicalMembership: pallet_membership::::{Module, Call, Storage, Event, Config}, + Treasury: pallet_treasury::{Module, Call, Storage, Event}, // Parachains stuff; slots are disabled (no auctions initially). The rest are safe as they // have no public dispatchables. Disabled `Call` on all of them, but this should be @@ -1129,21 +1129,21 @@ construct_runtime! { // Claims. Usable initially. Claims: claims::{Module, Call, Storage, Event, Config, ValidateUnsigned}, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: vesting::{Module, Call, Storage, Event, Config}, + Vesting: pallet_vesting::{Module, Call, Storage, Event, Config}, // Cunning utilities. Usable initially. - Utility: utility::{Module, Call, Event}, + Utility: pallet_utility::{Module, Call, Event}, // DOT Purchase module. Late addition; this is in place of Sudo. Purchase: purchase::{Module, Call, Storage, Event}, // Identity. Late addition. - Identity: identity::{Module, Call, Storage, Event}, + Identity: pallet_identity::{Module, Call, Storage, Event}, // Proxy module. Late addition. - Proxy: proxy::{Module, Call, Storage, Event}, + Proxy: pallet_proxy::{Module, Call, Storage, Event}, // Multisig dispatch. Late addition. - Multisig: multisig::{Module, Call, Storage, Event}, + Multisig: pallet_multisig::{Module, Call, Storage, Event}, } } @@ -1159,13 +1159,13 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckMortality, - system::CheckNonce, - system::CheckWeight, - transaction_payment::ChargeTransactionPayment, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckMortality, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, registrar::LimitParathreadCommits, parachains::ValidateDoubleVoteReports, claims::PrevalidateAttests, @@ -1175,10 +1175,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive< +pub type Executive = frame_executive::Executive< Runtime, Block, - system::ChainContext, + frame_system::ChainContext, Runtime, AllModules, CustomOnRuntimeUpgrade @@ -1385,13 +1385,13 @@ sp_api::impl_runtime_apis! { } } - impl system_rpc_runtime_api::AccountNonceApi for Runtime { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } - impl transaction_payment_rpc_runtime_api::TransactionPaymentApi< + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, > for Runtime { @@ -1455,19 +1455,19 @@ sp_api::impl_runtime_apis! { // Polkadot add_benchmark!(params, batches, claims, Claims); // Substrate - add_benchmark!(params, batches, balances, Balances); - add_benchmark!(params, batches, collective, Council); - add_benchmark!(params, batches, democracy, Democracy); - add_benchmark!(params, batches, elections_phragmen, ElectionsPhragmen); - add_benchmark!(params, batches, im_online, ImOnline); - add_benchmark!(params, batches, offences, OffencesBench::); - add_benchmark!(params, batches, scheduler, Scheduler); - add_benchmark!(params, batches, session, SessionBench::); - add_benchmark!(params, batches, staking, Staking); - add_benchmark!(params, batches, system, SystemBench::); - add_benchmark!(params, batches, timestamp, Timestamp); - add_benchmark!(params, batches, treasury, Treasury); - add_benchmark!(params, batches, vesting, Vesting); + add_benchmark!(params, batches, pallet_balances, Balances); + add_benchmark!(params, batches, pallet_collective, Council); + add_benchmark!(params, batches, pallet_democracy, Democracy); + add_benchmark!(params, batches, pallet_elections_phragmen, ElectionsPhragmen); + add_benchmark!(params, batches, pallet_im_online, ImOnline); + add_benchmark!(params, batches, pallet_offences, OffencesBench::); + add_benchmark!(params, batches, pallet_scheduler, Scheduler); + add_benchmark!(params, batches, pallet_session, SessionBench::); + add_benchmark!(params, batches, pallet_staking, Staking); + add_benchmark!(params, batches, frame_system, SystemBench::); + add_benchmark!(params, batches, pallet_timestamp, Timestamp); + add_benchmark!(params, batches, pallet_treasury, Treasury); + add_benchmark!(params, batches, pallet_vesting, Vesting); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/polkadot/src/weights/mod.rs b/runtime/polkadot/src/weights/mod.rs index 75cabca0c6e6..b94314e33942 100644 --- a/runtime/polkadot/src/weights/mod.rs +++ b/runtime/polkadot/src/weights/mod.rs @@ -16,4 +16,4 @@ /// A collection of weight modules used for pallets in the runtime. -pub mod balances; +pub mod pallet_balances; diff --git a/runtime/polkadot/src/weights/balances.rs b/runtime/polkadot/src/weights/pallet_balances.rs similarity index 97% rename from runtime/polkadot/src/weights/balances.rs rename to runtime/polkadot/src/weights/pallet_balances.rs index bc2f3ac18af2..53431ba48f2f 100644 --- a/runtime/polkadot/src/weights/balances.rs +++ b/runtime/polkadot/src/weights/pallet_balances.rs @@ -18,7 +18,7 @@ use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight}; pub struct WeightInfo; -impl balances::WeightInfo for WeightInfo { +impl pallet_balances::WeightInfo for WeightInfo { fn transfer() -> Weight { (65949000 as Weight) .saturating_add(DbWeight::get().reads(1 as Weight)) diff --git a/runtime/polkadot/tests/weights.rs b/runtime/polkadot/tests/weights.rs index 70f9d7e4f91a..51b925834199 100644 --- a/runtime/polkadot/tests/weights.rs +++ b/runtime/polkadot/tests/weights.rs @@ -19,7 +19,7 @@ //! //! These test are not meant to be exhaustive, as it is inevitable that //! weights in Substrate will change. Instead they are supposed to provide -//! some sort of indicator that calls we consider important (e.g Balances::transfer) +//! some sort of indicator that calls we consider important (e.g pallet_balances::transfer) //! have not suddenly changed from under us. use frame_support::{ @@ -32,14 +32,14 @@ use polkadot_runtime::{self, Runtime}; use primitives::v0::AccountId; use runtime_common::MaximumBlockWeight; -use democracy::Call as DemocracyCall; -use elections_phragmen::Call as PhragmenCall; -use session::Call as SessionCall; -use staking::Call as StakingCall; -use system::Call as SystemCall; -use treasury::Call as TreasuryCall; +use pallet_democracy::Call as DemocracyCall; +use pallet_elections_phragmen::Call as PhragmenCall; +use pallet_session::Call as SessionCall; +use pallet_staking::Call as StakingCall; +use frame_system::Call as SystemCall; +use pallet_treasury::Call as TreasuryCall; -type DbWeight = ::DbWeight; +type DbWeight = ::DbWeight; #[test] fn sanity_check_weight_per_time_constants_are_as_expected() { @@ -170,7 +170,7 @@ fn weight_of_democracy_propose_is_correct() { #[test] fn weight_of_democracy_vote_is_correct() { - use democracy::AccountVote; + use pallet_democracy::AccountVote; let vote = AccountVote::Standard { vote: Default::default(), balance: Default::default() }; // #[weight = 50_000_000 + 350_000 * Weight::from(T::MaxVotes::get()) + T::DbWeight::get().reads_writes(3, 3)] @@ -213,7 +213,7 @@ fn weight_of_phragmen_submit_candidacy_is_correct() { #[test] fn weight_of_phragmen_renounce_candidacy_is_correct() { let expected_weight = 46 * WEIGHT_PER_MICROS + DbWeight::get().reads_writes(2, 2); - let weight = PhragmenCall::renounce_candidacy::(elections_phragmen::Renouncing::Member) + let weight = PhragmenCall::renounce_candidacy::(pallet_elections_phragmen::Renouncing::Member) .get_dispatch_info().weight; assert_eq!(weight, expected_weight); @@ -240,7 +240,7 @@ fn weight_of_treasury_approve_proposal_is_correct() { #[test] fn weight_of_treasury_tip_is_correct() { - let max_len: Weight = ::Tippers::max_len() as Weight; + let max_len: Weight = ::Tippers::max_len() as Weight; // #[weight = 68_000_000 + 2_000_000 * T::Tippers::max_len() as Weight // + T::DbWeight::get().reads_writes(2, 1)] diff --git a/runtime/rococo-v1/Cargo.toml b/runtime/rococo-v1/Cargo.toml index 8a9228a6acd5..25e49e6e29d9 100644 --- a/runtime/rococo-v1/Cargo.toml +++ b/runtime/rococo-v1/Cargo.toml @@ -19,33 +19,33 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -version = { package = "sp-version", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authority-discovery = { package = "pallet-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" } -executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } @@ -60,23 +60,23 @@ default = ["std"] no_std = [] std = [ "authority-discovery-primitives/std", - "authority-discovery/std", - "authorship/std", - "babe/std", + "pallet-authority-discovery/std", + "pallet-authorship/std", + "pallet-babe/std", "babe-primitives/std", - "balances/std", + "pallet-balances/std", "codec/std", - "executive/std", - "grandpa/std", - "indices/std", - "im-online/std", + "frame-executive/std", + "pallet-grandpa/std", + "pallet-indices/std", + "pallet-im-online/std", "inherents/std", "frame-support/std", "polkadot-parachain/std", "primitives/std", "runtime-common/std", "runtime-parachains/std", - "session/std", + "pallet-session/std", "sp-api/std", "sp-core/std", "sp-io/std", @@ -84,17 +84,17 @@ std = [ "sp-session/std", "sp-staking/std", "sp-std/std", - "staking/std", - "system/std", - "system_rpc_runtime_api/std", + "pallet-staking/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", "offchain-primitives/std", - "offences/std", - "timestamp/std", - "transaction-payment/std", - "transaction-payment-rpc-runtime-api/std", + "pallet-offences/std", + "pallet-timestamp/std", + "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", "block-builder-api/std", "tx-pool-api/std", - "version/std", + "sp-version/std", "serde_derive", "serde/std", ] diff --git a/runtime/rococo-v1/src/constants.rs b/runtime/rococo-v1/src/constants.rs index de95703fccd1..a565ca4dbcfd 100644 --- a/runtime/rococo-v1/src/constants.rs +++ b/runtime/rococo-v1/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, system::MaximumBlockWeight] + /// - [0, frame_system::MaximumBlockWeight] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: diff --git a/runtime/rococo-v1/src/lib.rs b/runtime/rococo-v1/src/lib.rs index d7df68199d04..f1af47613ed1 100644 --- a/runtime/rococo-v1/src/lib.rs +++ b/runtime/rococo-v1/src/lib.rs @@ -52,15 +52,15 @@ use sp_runtime::{ Extrinsic as ExtrinsicT, SaturatedConversion, Verify, }, }; -use im_online::sr25519::AuthorityId as ImOnlineId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use version::RuntimeVersion; -use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_version::RuntimeVersion; +use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; -use session::historical as session_historical; -use system::EnsureRoot; +use pallet_session::historical as session_historical; +use frame_system::EnsureRoot; use runtime_common::paras_sudo_wrapper as paras_sudo_wrapper; use runtime_parachains::configuration as parachains_configuration; @@ -70,7 +70,7 @@ use runtime_parachains::initializer as parachains_initializer; use runtime_parachains::paras as parachains_paras; use runtime_parachains::scheduler as parachains_scheduler; -pub use balances::Call as BalancesCall; +pub use pallet_balances::Call as BalancesCall; /// Constant values used within the runtime. pub mod constants; @@ -92,13 +92,13 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckMortality, - system::CheckNonce, - system::CheckWeight, - transaction_payment::ChargeTransactionPayment, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckMortality, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, ); #[cfg(not(feature = "disable-runtime-api"))] @@ -305,13 +305,13 @@ sp_api::impl_runtime_apis! { } } - impl system_rpc_runtime_api::AccountNonceApi for Runtime { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } - impl transaction_payment_rpc_runtime_api::TransactionPaymentApi< + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, > for Runtime { @@ -325,7 +325,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive, Runtime, AllModules>; +pub type Executive = frame_executive::Executive, Runtime, AllModules>; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -343,25 +343,25 @@ construct_runtime! { NodeBlock = primitives::v1::Block, UncheckedExtrinsic = UncheckedExtrinsic { - System: system::{Module, Call, Storage, Config, Event}, + System: frame_system::{Module, Call, Storage, Config, Event}, // Must be before session. - Babe: babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, - Timestamp: timestamp::{Module, Call, Storage, Inherent}, - Indices: indices::{Module, Call, Storage, Config, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - TransactionPayment: transaction_payment::{Module, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, + Indices: pallet_indices::{Module, Call, Storage, Config, Event}, + Balances: pallet_balances::{Module, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Module, Storage}, // Consensus support. - Authorship: authorship::{Module, Call, Storage}, - Staking: staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - Offences: offences::{Module, Call, Storage, Event}, + Authorship: pallet_authorship::{Module, Call, Storage}, + Staking: pallet_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + Offences: pallet_offences::{Module, Call, Storage, Event}, Historical: session_historical::{Module}, - Session: session::{Module, Call, Storage, Event, Config}, - Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, - AuthorityDiscovery: authority_discovery::{Module, Call, Config}, + Session: pallet_session::{Module, Call, Storage, Event, Config}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, // Parachains modules. Config: parachains_configuration::{Module, Call, Storage}, @@ -392,7 +392,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] - apis: version::create_apis_vec![[]], + apis: sp_version::create_apis_vec![[]], transaction_version: 2, }; @@ -400,7 +400,7 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } -impl system::Trait for Runtime { +impl frame_system::Trait for Runtime { type BaseCallFilter = BaseFilter; type Origin = Origin; type Call = Call; @@ -422,7 +422,7 @@ impl system::Trait for Runtime { type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type ModuleToIndex = ModuleToIndex; - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); @@ -438,14 +438,14 @@ parameter_types! { /// Submits a transaction with the node's public and signature type. Adheres to the signed extension /// format of the chain. -impl system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, public: ::Signer, account: AccountId, - nonce: ::Index, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { // take the biggest period possible. let period = BlockHashCount::get() @@ -460,13 +460,13 @@ impl system::offchain::CreateSignedTransaction for Runtime .saturating_sub(1); let tip = 0; let extra: SignedExtra = ( - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - transaction_payment::ChargeTransactionPayment::::from(tip), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), ); let raw_payload = SignedPayload::new(call, extra).map_err(|e| { debug::warn!("Unable to create signed payload: {:?}", e); @@ -479,14 +479,14 @@ impl system::offchain::CreateSignedTransaction for Runtime } } -impl system::offchain::SigningTypes for Runtime { +impl frame_system::offchain::SigningTypes for Runtime { type Public = ::Signer; type Signature = Signature; } -impl session::historical::Trait for Runtime { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; +impl pallet_session::historical::Trait for Runtime { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } pallet_staking_reward_curve::build! { @@ -504,9 +504,9 @@ parameter_types! { // Six sessions in an era (6 hours). pub const SessionsPerEra: SessionIndex = 6; // 28 eras for unbonding (7 days). - pub const BondingDuration: staking::EraIndex = 28; + pub const BondingDuration: pallet_staking::EraIndex = 28; // 27 eras in which slashes can be cancelled (~7 days). - pub const SlashDeferDuration: staking::EraIndex = 27; + pub const SlashDeferDuration: pallet_staking::EraIndex = 27; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; // quarter of the last session will be for election. @@ -524,7 +524,7 @@ parameter_types! { pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); } -impl im_online::Trait for Runtime { +impl pallet_im_online::Trait for Runtime { type AuthorityId = ImOnlineId; type Event = Event; type ReportUnresponsiveness = Offences; @@ -533,7 +533,7 @@ impl im_online::Trait for Runtime { type WeightInfo = (); } -impl staking::Trait for Runtime { +impl pallet_staking::Trait for Runtime { type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = CurrencyToVoteHandler; @@ -562,7 +562,7 @@ parameter_types! { pub const ExistentialDeposit: Balance = 1 * CENTS; } -impl balances::Trait for Runtime { +impl pallet_balances::Trait for Runtime { type Balance = Balance; type DustRemoval = (); type Event = Event; @@ -571,7 +571,7 @@ impl balances::Trait for Runtime { type WeightInfo = (); } -impl system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From, { type OverarchingCall = Call; @@ -588,20 +588,20 @@ parameter_types! { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } -impl offences::Trait for Runtime { +impl pallet_offences::Trait for Runtime { type Event = Event; - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); } -impl authority_discovery::Trait for Runtime {} +impl pallet_authority_discovery::Trait for Runtime {} parameter_types! { pub const MinimumPeriod: u64 = SLOT_DURATION / 2; } -impl timestamp::Trait for Runtime { +impl pallet_timestamp::Trait for Runtime { type Moment = u64; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; @@ -612,7 +612,7 @@ parameter_types! { pub const TransactionByteFee: Balance = 10 * MILLICENTS; } -impl transaction_payment::Trait for Runtime { +impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = ToAuthor; type TransactionByteFee = TransactionByteFee; @@ -624,13 +624,13 @@ parameter_types! { pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); } -impl session::Trait for Runtime { +impl pallet_session::Trait for Runtime { type Event = Event; type ValidatorId = AccountId; - type ValidatorIdOf = staking::StashOf; + type ValidatorIdOf = pallet_staking::StashOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - type SessionManager = session::historical::NoteHistoricalRoot; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; @@ -642,34 +642,34 @@ parameter_types! { pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; } -impl babe::Trait for Runtime { +impl pallet_babe::Trait for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = Historical; type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = - babe::EquivocationHandler; + pallet_babe::EquivocationHandler; } parameter_types! { pub const IndexDeposit: Balance = 1 * DOLLARS; } -impl indices::Trait for Runtime { +impl pallet_indices::Trait for Runtime { type AccountIndex = AccountIndex; type Currency = Balances; type Deposit = IndexDeposit; @@ -681,7 +681,7 @@ parameter_types! { pub const AttestationPeriod: BlockNumber = 50; } -impl grandpa::Trait for Runtime { +impl pallet_grandpa::Trait for Runtime { type Event = Event; type Call = Call; @@ -695,7 +695,7 @@ impl grandpa::Trait for Runtime { GrandpaId, )>>::IdentificationTuple; - type HandleEquivocation = grandpa::EquivocationHandler; + type HandleEquivocation = pallet_grandpa::EquivocationHandler; } parameter_types! { @@ -703,8 +703,8 @@ parameter_types! { } // TODO: substrate#2986 implement this properly -impl authorship::Trait for Runtime { - type FindAuthor = session::FindAccountFromAuthorIndex; +impl pallet_authorship::Trait for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; type FilterUncle = (); type EventHandler = (Staking, ImOnline); diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index 5eb029fbf3a2..804baa3dfb69 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -7,63 +7,62 @@ build = "build.rs" [dependencies] bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } -codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] } log = { version = "0.3.9", optional = true } rustc-hex = { version = "2.0.1", default-features = false } serde = { version = "1.0.102", default-features = false } serde_derive = { version = "1.0.102", optional = true } -smallvec = "1.4.0" static_assertions = "1.1.0" +smallvec = "1.4.1" authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -version = { package = "sp-version", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authority-discovery = { package = "pallet-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -collective = { package = "pallet-collective", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -democracy = { package = "pallet-democracy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -membership = { package = "pallet-membership", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -multisig = { package = "pallet-multisig", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -proxy = { package = "pallet-proxy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -recovery = { package = "pallet-recovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -scheduler = { package = "pallet-scheduler", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -society = { package = "pallet-society", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-finality-tracker = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" } -sudo = { package = "pallet-sudo", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -utility = { package = "pallet-utility", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -92,7 +91,7 @@ no_std = [] only-staking = [] std = [ "authority-discovery-primitives/std", - "authority-discovery/std", + "pallet-authority-discovery/std", "bitvec/std", "primitives/std", "rustc-hex/std", @@ -107,67 +106,63 @@ std = [ "sp-std/std", "sp-io/std", "frame-support/std", - "authorship/std", - "balances/std", - "transaction-payment/std", - "transaction-payment-rpc-runtime-api/std", - "collective/std", - "elections-phragmen/std", - "democracy/std", - "executive/std", - "finality-tracker/std", - "grandpa/std", - "identity/std", - "im-online/std", - "indices/std", - "membership/std", - "multisig/std", - "nicks/std", - "offences/std", - "proxy/std", - "recovery/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-collective/std", + "pallet-elections-phragmen/std", + "pallet-democracy/std", + "frame-executive/std", + "pallet-finality-tracker/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-indices/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-nicks/std", + "pallet-offences/std", + "pallet-proxy/std", + "pallet-recovery/std", "sp-runtime/std", - "scheduler/std", - "session/std", - "society/std", - "staking/std", - "sudo/std", - "system/std", - "system_rpc_runtime_api/std", - "timestamp/std", - "treasury/std", - "version/std", - "utility/std", - "vesting/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-staking/std", + "pallet-sudo/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "pallet-timestamp/std", + "pallet-treasury/std", + "sp-version/std", "serde_derive", "serde/std", "log", - "babe/std", + "pallet-babe/std", "babe-primitives/std", "sp-session/std", - "randomness-collective-flip/std", + "pallet-randomness-collective-flip/std", "runtime-common/std", + "pallet-vesting/std", + "pallet-utility/std", ] runtime-benchmarks = [ "runtime-common/runtime-benchmarks", "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system-benchmarking", - "system/runtime-benchmarks", + "frame-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "balances/runtime-benchmarks", - "collective/runtime-benchmarks", - "democracy/runtime-benchmarks", - "elections-phragmen/runtime-benchmarks", - "identity/runtime-benchmarks", - "im-online/runtime-benchmarks", - "scheduler/runtime-benchmarks", - "society/runtime-benchmarks", - "staking/runtime-benchmarks", - "timestamp/runtime-benchmarks", - "treasury/runtime-benchmarks", - "utility/runtime-benchmarks", - "vesting/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-vesting/runtime-benchmarks", "pallet-offences-benchmarking", "pallet-session-benchmarking", # uncomment when it is made optional again diff --git a/runtime/rococo/src/constants.rs b/runtime/rococo/src/constants.rs index de95703fccd1..a565ca4dbcfd 100644 --- a/runtime/rococo/src/constants.rs +++ b/runtime/rococo/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, system::MaximumBlockWeight] + /// - [0, frame_system::MaximumBlockWeight] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 3083c002f395..c8fa47230a19 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -44,28 +44,28 @@ use sp_runtime::{ }; #[cfg(feature = "runtime-benchmarks")] use sp_runtime::RuntimeString; -use version::RuntimeVersion; -use grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_version::RuntimeVersion; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; #[cfg(any(feature = "std", test))] -use version::NativeVersion; +use sp_version::NativeVersion; use sp_core::OpaqueMetadata; use frame_support::{ parameter_types, construct_runtime, debug, RuntimeDebug, traits::{KeyOwnerProofSystem, Randomness, Filter, InstanceFilter}, weights::Weight, }; -use im_online::sr25519::AuthorityId as ImOnlineId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use session::historical as session_historical; -use system::EnsureRoot; +use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; +use pallet_session::historical as session_historical; +use frame_system::EnsureRoot; #[cfg(feature = "std")] -pub use staking::StakerStatus; +pub use pallet_staking::StakerStatus; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use timestamp::Call as TimestampCall; -pub use balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +pub use pallet_balances::Call as BalancesCall; pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER}; pub use parachains::Call as ParachainsCall; @@ -112,7 +112,7 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } -impl system::Trait for Runtime { +impl frame_system::Trait for Runtime { type BaseCallFilter = BaseFilter; type Origin = Origin; type Call = Call; @@ -134,13 +134,13 @@ impl system::Trait for Runtime { type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type ModuleToIndex = ModuleToIndex; - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } -impl scheduler::Trait for Runtime { +impl pallet_scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; type PalletsOrigin = OriginCaller; @@ -155,34 +155,34 @@ parameter_types! { pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; } -impl babe::Trait for Runtime { +impl pallet_babe::Trait for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = Historical; type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = - babe::EquivocationHandler; + pallet_babe::EquivocationHandler; } parameter_types! { pub const IndexDeposit: Balance = 1 * DOLLARS; } -impl indices::Trait for Runtime { +impl pallet_indices::Trait for Runtime { type AccountIndex = AccountIndex; type Currency = Balances; type Deposit = IndexDeposit; @@ -194,7 +194,7 @@ parameter_types! { pub const ExistentialDeposit: Balance = 1 * CENTS; } -impl balances::Trait for Runtime { +impl pallet_balances::Trait for Runtime { type Balance = Balance; type DustRemoval = (); type Event = Event; @@ -207,7 +207,7 @@ parameter_types! { pub const TransactionByteFee: Balance = 10 * MILLICENTS; } -impl transaction_payment::Trait for Runtime { +impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = ToAuthor; type TransactionByteFee = TransactionByteFee; @@ -218,7 +218,7 @@ impl transaction_payment::Trait for Runtime { parameter_types! { pub const MinimumPeriod: u64 = SLOT_DURATION / 2; } -impl timestamp::Trait for Runtime { +impl pallet_timestamp::Trait for Runtime { type Moment = u64; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; @@ -230,8 +230,8 @@ parameter_types! { } // TODO: substrate#2986 implement this properly -impl authorship::Trait for Runtime { - type FindAuthor = session::FindAccountFromAuthorIndex; +impl pallet_authorship::Trait for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; type FilterUncle = (); type EventHandler = ImOnline; @@ -256,7 +256,7 @@ parameter_types! { pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); } -impl session::Trait for Runtime { +impl pallet_session::Trait for Runtime { type Event = Event; type ValidatorId = AccountId; type ValidatorIdOf = (); @@ -269,7 +269,7 @@ impl session::Trait for Runtime { type WeightInfo = (); } -impl session::historical::Trait for Runtime { +impl pallet_session::historical::Trait for Runtime { type FullIdentification = (); type FullIdentificationOf = (); } @@ -287,9 +287,9 @@ pallet_staking_reward_curve::build! { parameter_types! { // 28 eras for unbonding (7 days). - pub const BondingDuration: staking::EraIndex = 28; + pub const BondingDuration: pallet_staking::EraIndex = 28; // 28 eras in which slashes can be cancelled (7 days). - pub const SlashDeferDuration: staking::EraIndex = 27; + pub const SlashDeferDuration: pallet_staking::EraIndex = 27; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; // quarter of the last session will be for election. @@ -314,15 +314,15 @@ parameter_types! { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } -impl offences::Trait for Runtime { +impl pallet_offences::Trait for Runtime { type Event = Event; - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = (); type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); } -impl authority_discovery::Trait for Runtime {} +impl pallet_authority_discovery::Trait for Runtime {} parameter_types! { pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_BLOCKS as _; @@ -333,7 +333,7 @@ parameter_types! { pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); } -impl im_online::Trait for Runtime { +impl pallet_im_online::Trait for Runtime { type AuthorityId = ImOnlineId; type Event = Event; type ReportUnresponsiveness = Offences; @@ -342,7 +342,7 @@ impl im_online::Trait for Runtime { type WeightInfo = (); } -impl grandpa::Trait for Runtime { +impl pallet_grandpa::Trait for Runtime { type Event = Event; type Call = Call; @@ -356,15 +356,15 @@ impl grandpa::Trait for Runtime { GrandpaId, )>>::IdentificationTuple; - type HandleEquivocation = grandpa::EquivocationHandler; + type HandleEquivocation = pallet_grandpa::EquivocationHandler; } parameter_types! { - pub WindowSize: BlockNumber = finality_tracker::DEFAULT_WINDOW_SIZE.into(); - pub ReportLatency: BlockNumber = finality_tracker::DEFAULT_REPORT_LATENCY.into(); + pub WindowSize: BlockNumber = pallet_finality_tracker::DEFAULT_WINDOW_SIZE.into(); + pub ReportLatency: BlockNumber = pallet_finality_tracker::DEFAULT_REPORT_LATENCY.into(); } -impl finality_tracker::Trait for Runtime { +impl pallet_finality_tracker::Trait for Runtime { type OnFinalizationStalled = (); type WindowSize = WindowSize; type ReportLatency = ReportLatency; @@ -405,7 +405,7 @@ impl parachains::Trait for Runtime { type SlashPeriod = SlashPeriod; type Proof = sp_session::MembershipProof; - type KeyOwnerProofSystem = session::historical::Module; + type KeyOwnerProofSystem = pallet_session::historical::Module; type IdentificationTuple = )>>::IdentificationTuple; type ReportOffence = Offences; type BlockHashConversion = sp_runtime::traits::Identity; @@ -413,14 +413,14 @@ impl parachains::Trait for Runtime { /// Submits a transaction with the node's public and signature type. Adheres to the signed extension /// format of the chain. -impl system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, public: ::Signer, account: AccountId, - nonce: ::Index, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { // take the biggest period possible. let period = BlockHashCount::get() @@ -435,13 +435,13 @@ impl system::offchain::CreateSignedTransaction for Runtime .saturating_sub(1); let tip = 0; let extra: SignedExtra = ( - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - transaction_payment::ChargeTransactionPayment::::from(tip), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), registrar::LimitParathreadCommits::::new(), parachains::ValidateDoubleVoteReports::::new(), ); @@ -456,12 +456,12 @@ impl system::offchain::CreateSignedTransaction for Runtime } } -impl system::offchain::SigningTypes for Runtime { +impl frame_system::offchain::SigningTypes for Runtime { type Public = ::Signer; type Signature = Signature; } -impl system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From, { type OverarchingCall = Call; @@ -494,7 +494,7 @@ parameter_types! { pub const MaxRegistrars: u32 = 20; } -impl identity::Trait for Runtime { +impl pallet_identity::Trait for Runtime { type Event = Event; type Currency = Balances; type Slashed = (); @@ -504,12 +504,12 @@ impl identity::Trait for Runtime { type MaxSubAccounts = MaxSubAccounts; type MaxAdditionalFields = MaxAdditionalFields; type MaxRegistrars = MaxRegistrars; - type RegistrarOrigin = system::EnsureRoot; - type ForceOrigin = system::EnsureRoot; + type RegistrarOrigin = frame_system::EnsureRoot; + type ForceOrigin = frame_system::EnsureRoot; type WeightInfo = (); } -impl utility::Trait for Runtime { +impl pallet_utility::Trait for Runtime { type Event = Event; type Call = Call; type WeightInfo = (); @@ -523,7 +523,7 @@ parameter_types! { pub const MaxSignatories: u16 = 100; } -impl multisig::Trait for Runtime { +impl pallet_multisig::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -540,7 +540,7 @@ parameter_types! { pub const RecoveryDeposit: Balance = 5 * DOLLARS; } -impl recovery::Trait for Runtime { +impl pallet_recovery::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -554,7 +554,7 @@ parameter_types! { pub const MinVestedTransfer: Balance = 100 * DOLLARS; } -impl vesting::Trait for Runtime { +impl pallet_vesting::Trait for Runtime { type Event = Event; type Currency = Balances; type BlockNumberToBalance = ConvertInto; @@ -562,7 +562,7 @@ impl vesting::Trait for Runtime { type WeightInfo = (); } -impl sudo::Trait for Runtime { +impl pallet_sudo::Trait for Runtime { type Event = Event; type Call = Call; } @@ -592,9 +592,9 @@ impl InstanceFilter for ProxyType { Call::System(..) | Call::Babe(..) | Call::Timestamp(..) | - Call::Indices(indices::Call::claim(..)) | - Call::Indices(indices::Call::free(..)) | - Call::Indices(indices::Call::freeze(..)) | + Call::Indices(pallet_indices::Call::claim(..)) | + Call::Indices(pallet_indices::Call::free(..)) | + Call::Indices(pallet_indices::Call::freeze(..)) | // Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting the entire Balances pallet Call::Authorship(..) | @@ -609,15 +609,15 @@ impl InstanceFilter for ProxyType { Call::Registrar(..) | Call::Utility(..) | Call::Identity(..) | - Call::Recovery(recovery::Call::as_recovered(..)) | - Call::Recovery(recovery::Call::vouch_recovery(..)) | - Call::Recovery(recovery::Call::claim_recovery(..)) | - Call::Recovery(recovery::Call::close_recovery(..)) | - Call::Recovery(recovery::Call::remove_recovery(..)) | - Call::Recovery(recovery::Call::cancel_recovered(..)) | + Call::Recovery(pallet_recovery::Call::as_recovered(..)) | + Call::Recovery(pallet_recovery::Call::vouch_recovery(..)) | + Call::Recovery(pallet_recovery::Call::claim_recovery(..)) | + Call::Recovery(pallet_recovery::Call::close_recovery(..)) | + Call::Recovery(pallet_recovery::Call::remove_recovery(..)) | + Call::Recovery(pallet_recovery::Call::cancel_recovered(..)) | // Specifically omitting Recovery `create_recovery`, `initiate_recovery` - Call::Vesting(vesting::Call::vest(..)) | - Call::Vesting(vesting::Call::vest_other(..)) | + Call::Vesting(pallet_vesting::Call::vest(..)) | + Call::Vesting(pallet_vesting::Call::vest_other(..)) | // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` Call::Scheduler(..) | // Specifically omitting Sudo pallet @@ -625,13 +625,13 @@ impl InstanceFilter for ProxyType { Call::Multisig(..) ), ProxyType::SudoBalances => match c { - Call::Sudo(sudo::Call::sudo(ref x)) => matches!(x.as_ref(), &Call::Balances(..)), + Call::Sudo(pallet_sudo::Call::sudo(ref x)) => matches!(x.as_ref(), &Call::Balances(..)), Call::Utility(..) => true, _ => false, }, ProxyType::IdentityJudgement => matches!(c, - Call::Identity(identity::Call::provide_judgement(..)) - | Call::Utility(utility::Call::batch(..)) + Call::Identity(pallet_identity::Call::provide_judgement(..)) + | Call::Utility(pallet_utility::Call::batch(..)) ) } } @@ -646,7 +646,7 @@ impl InstanceFilter for ProxyType { } } -impl proxy::Trait for Runtime { +impl pallet_proxy::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -664,26 +664,26 @@ construct_runtime! { UncheckedExtrinsic = UncheckedExtrinsic { // Basic stuff; balances is uncallable initially. - System: system::{Module, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage}, + System: frame_system::{Module, Call, Storage, Config, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage}, // Must be before session. - Babe: babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, - Timestamp: timestamp::{Module, Call, Storage, Inherent}, - Indices: indices::{Module, Call, Storage, Config, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - TransactionPayment: transaction_payment::{Module, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, + Indices: pallet_indices::{Module, Call, Storage, Config, Event}, + Balances: pallet_balances::{Module, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Module, Storage}, // Consensus support. - Authorship: authorship::{Module, Call, Storage}, - Offences: offences::{Module, Call, Storage, Event}, + Authorship: pallet_authorship::{Module, Call, Storage}, + Offences: pallet_offences::{Module, Call, Storage, Event}, Historical: session_historical::{Module}, - Session: session::{Module, Call, Storage, Event, Config}, - FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent}, - Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, - AuthorityDiscovery: authority_discovery::{Module, Call, Config}, + Session: pallet_session::{Module, Call, Storage, Event, Config}, + FinalityTracker: pallet_finality_tracker::{Module, Call, Storage, Inherent}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, // Parachains stuff; slots are disabled (no auctions initially). The rest are safe as they // have no public dispatchables. @@ -692,28 +692,28 @@ construct_runtime! { Registrar: registrar::{Module, Call, Storage, Event, Config}, // Utility module. - Utility: utility::{Module, Call, Event}, + Utility: pallet_utility::{Module, Call, Event}, // Less simple identity module. - Identity: identity::{Module, Call, Storage, Event}, + Identity: pallet_identity::{Module, Call, Storage, Event}, // Social recovery module. - Recovery: recovery::{Module, Call, Storage, Event}, + Recovery: pallet_recovery::{Module, Call, Storage, Event}, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: vesting::{Module, Call, Storage, Event, Config}, + Vesting: pallet_vesting::{Module, Call, Storage, Event, Config}, // System scheduler. - Scheduler: scheduler::{Module, Call, Storage, Event}, + Scheduler: pallet_scheduler::{Module, Call, Storage, Event}, // Sudo. - Sudo: sudo::{Module, Call, Storage, Event, Config}, + Sudo: pallet_sudo::{Module, Call, Storage, Event, Config}, // Proxy module. Late addition. - Proxy: proxy::{Module, Call, Storage, Event}, + Proxy: pallet_proxy::{Module, Call, Storage, Event}, // Multisig module. Late addition. - Multisig: multisig::{Module, Call, Storage, Event}, + Multisig: pallet_multisig::{Module, Call, Storage, Event}, } } @@ -729,13 +729,13 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckMortality, - system::CheckNonce, - system::CheckWeight, - transaction_payment::ChargeTransactionPayment, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckMortality, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, registrar::LimitParathreadCommits, parachains::ValidateDoubleVoteReports, ); @@ -744,7 +744,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive, Runtime, AllModules>; +pub type Executive = frame_executive::Executive, Runtime, AllModules>; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -947,13 +947,13 @@ sp_api::impl_runtime_apis! { } } - impl system_rpc_runtime_api::AccountNonceApi for Runtime { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } - impl transaction_payment_rpc_runtime_api::TransactionPaymentApi< + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, > for Runtime { @@ -1005,17 +1005,17 @@ sp_api::impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist); - add_benchmark!(params, batches, balances,Balances); - add_benchmark!(params, batches, identity,Identity); - add_benchmark!(params, batches, im_online,ImOnline); - add_benchmark!(params, batches, offences,OffencesBench::); - add_benchmark!(params, batches, scheduler, Scheduler); - add_benchmark!(params, batches, session, SessionBench::); - add_benchmark!(params, batches, staking, Staking); - add_benchmark!(params, batches, system, SystemBench::); - add_benchmark!(params, batches, timestamp, Timestamp); - add_benchmark!(params, batches, utility, Utility); - add_benchmark!(params, batches, vesting, Vesting); + add_benchmark!(params, batches, pallet_balances, Balances); + add_benchmark!(params, batches, pallet_identity, Identity); + add_benchmark!(params, batches, pallet_im_online, ImOnline); + add_benchmark!(params, batches, pallet_offences, OffencesBench::); + add_benchmark!(params, batches, pallet_scheduler, Scheduler); + add_benchmark!(params, batches, pallet_session, SessionBench::); + add_benchmark!(params, batches, pallet_staking, Staking); + add_benchmark!(params, batches, frame_system, SystemBench::); + add_benchmark!(params, batches, pallet_timestamp, Timestamp); + add_benchmark!(params, batches, pallet_utility, Utility); + add_benchmark!(params, batches, pallet_vesting, Vesting); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) diff --git a/runtime/test-runtime/Cargo.toml b/runtime/test-runtime/Cargo.toml index 100b373935f5..4dc975c68992 100644 --- a/runtime/test-runtime/Cargo.toml +++ b/runtime/test-runtime/Cargo.toml @@ -25,32 +25,32 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -version = { package = "sp-version", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authority-discovery = { package = "pallet-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-finality-tracker = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sudo = { package = "pallet-sudo", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false } primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } @@ -73,7 +73,7 @@ no_std = [] only-staking = [] std = [ "authority-discovery-primitives/std", - "authority-discovery/std", + "pallet-authority-discovery/std", "bitvec/std", "primitives/std", "rustc-hex/std", @@ -88,31 +88,31 @@ std = [ "rstd/std", "sp-io/std", "frame-support/std", - "authorship/std", - "balances/std", - "transaction-payment/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", - "executive/std", - "finality-tracker/std", - "grandpa/std", - "indices/std", - "nicks/std", - "offences/std", + "frame-executive/std", + "pallet-finality-tracker/std", + "pallet-grandpa/std", + "pallet-indices/std", + "pallet-nicks/std", + "pallet-offences/std", "sp-runtime/std", "sp-staking/std", - "session/std", - "staking/std", - "system/std", - "system_rpc_runtime_api/std", - "timestamp/std", - "version/std", - "vesting/std", + "pallet-session/std", + "pallet-staking/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "pallet-timestamp/std", + "sp-version/std", + "pallet-vesting/std", "serde_derive", "serde/std", "log", - "babe/std", + "pallet-babe/std", "babe-primitives/std", "sp-session/std", - "randomness-collective-flip/std", + "pallet-randomness-collective-flip/std", "runtime-common/std", ] diff --git a/runtime/test-runtime/src/constants.rs b/runtime/test-runtime/src/constants.rs index ac90417b214c..b18501b714b1 100644 --- a/runtime/test-runtime/src/constants.rs +++ b/runtime/test-runtime/src/constants.rs @@ -59,7 +59,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, system::MaximumBlockWeight] + /// - [0, frame_system::MaximumBlockWeight] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index aa92b40e78a1..18df03333c2c 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -45,10 +45,10 @@ use sp_runtime::{ DispatchInfoOf, Extrinsic as ExtrinsicT, SaturatedConversion, Verify, }, }; -use version::RuntimeVersion; -use grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_version::RuntimeVersion; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; #[cfg(any(feature = "std", test))] -use version::NativeVersion; +use sp_version::NativeVersion; use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; use frame_support::{ @@ -58,14 +58,14 @@ use frame_support::{ }; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use session::historical as session_historical; +use pallet_session::historical as session_historical; #[cfg(feature = "std")] -pub use staking::StakerStatus; +pub use pallet_staking::StakerStatus; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use timestamp::Call as TimestampCall; -pub use balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +pub use pallet_balances::Call as BalancesCall; pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER}; pub use parachains::Call as ParachainsCall; @@ -130,7 +130,7 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } -impl system::Trait for Runtime { +impl frame_system::Trait for Runtime { type BaseCallFilter = (); type Origin = Origin; type Call = Call; @@ -152,13 +152,13 @@ impl system::Trait for Runtime { type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type ModuleToIndex = ModuleToIndex; - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } -impl system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From, { type OverarchingCall = Call; @@ -170,23 +170,23 @@ parameter_types! { pub storage ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; } -impl babe::Trait for Runtime { +impl pallet_babe::Trait for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = (); type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = (); @@ -196,7 +196,7 @@ parameter_types! { pub storage IndexDeposit: Balance = 1 * DOLLARS; } -impl indices::Trait for Runtime { +impl pallet_indices::Trait for Runtime { type AccountIndex = AccountIndex; type Currency = Balances; type Deposit = IndexDeposit; @@ -208,7 +208,7 @@ parameter_types! { pub storage ExistentialDeposit: Balance = 1 * CENTS; } -impl balances::Trait for Runtime { +impl pallet_balances::Trait for Runtime { type Balance = Balance; type DustRemoval = (); type Event = Event; @@ -221,7 +221,7 @@ parameter_types! { pub storage TransactionByteFee: Balance = 10 * MILLICENTS; } -impl transaction_payment::Trait for Runtime { +impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = (); type TransactionByteFee = TransactionByteFee; @@ -233,7 +233,7 @@ parameter_types! { pub storage SlotDuration: u64 = SLOT_DURATION; pub storage MinimumPeriod: u64 = SlotDuration::get() / 2; } -impl timestamp::Trait for Runtime { +impl pallet_timestamp::Trait for Runtime { type Moment = u64; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; @@ -245,8 +245,8 @@ parameter_types! { } // TODO: substrate#2986 implement this properly -impl authorship::Trait for Runtime { - type FindAuthor = session::FindAccountFromAuthorIndex; +impl pallet_authorship::Trait for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; type FilterUncle = (); type EventHandler = Staking; @@ -269,10 +269,10 @@ parameter_types! { pub storage DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); } -impl session::Trait for Runtime { +impl pallet_session::Trait for Runtime { type Event = Event; type ValidatorId = AccountId; - type ValidatorIdOf = staking::StashOf; + type ValidatorIdOf = pallet_staking::StashOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; type SessionManager = Staking; @@ -282,9 +282,9 @@ impl session::Trait for Runtime { type WeightInfo = (); } -impl session::historical::Trait for Runtime { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; +impl pallet_session::historical::Trait for Runtime { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } pallet_staking_reward_curve::build! { @@ -302,9 +302,9 @@ parameter_types! { // Six sessions in an era (6 hours). pub storage SessionsPerEra: SessionIndex = 6; // 28 eras for unbonding (7 days). - pub storage BondingDuration: staking::EraIndex = 28; + pub storage BondingDuration: pallet_staking::EraIndex = 28; // 27 eras in which slashes can be cancelled (a bit less than 7 days). - pub storage SlashDeferDuration: staking::EraIndex = 27; + pub storage SlashDeferDuration: pallet_staking::EraIndex = 27; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub storage MaxNominatorRewardedPerValidator: u32 = 64; pub storage ElectionLookahead: BlockNumber = 0; @@ -313,7 +313,7 @@ parameter_types! { pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); } -impl staking::Trait for Runtime { +impl pallet_staking::Trait for Runtime { type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = CurrencyToVoteHandler; @@ -325,7 +325,7 @@ impl staking::Trait for Runtime { type BondingDuration = BondingDuration; type SlashDeferDuration = SlashDeferDuration; // A majority of the council can cancel the slash. - type SlashCancelOrigin = system::EnsureNever<()>; + type SlashCancelOrigin = frame_system::EnsureNever<()>; type SessionInterface = Self; type RewardCurve = RewardCurve; type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; @@ -339,7 +339,7 @@ impl staking::Trait for Runtime { } -impl grandpa::Trait for Runtime { +impl pallet_grandpa::Trait for Runtime { type Event = Event; type Call = Call; @@ -392,7 +392,7 @@ impl parachains::Trait for Runtime { type SlashPeriod = SlashPeriod; type Proof = sp_session::MembershipProof; - type KeyOwnerProofSystem = session::historical::Module; + type KeyOwnerProofSystem = pallet_session::historical::Module; type IdentificationTuple = < Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec)> >::IdentificationTuple; @@ -400,14 +400,14 @@ impl parachains::Trait for Runtime { type BlockHashConversion = sp_runtime::traits::Identity; } -impl system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, public: ::Signer, account: AccountId, - nonce: ::Index, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { let period = BlockHashCount::get() .checked_next_power_of_two() @@ -420,13 +420,13 @@ impl system::offchain::CreateSignedTransaction for Runtime let tip = 0; let extra: SignedExtra = ( RestrictFunctionality, - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - transaction_payment::ChargeTransactionPayment::::from(tip), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), registrar::LimitParathreadCommits::::new(), parachains::ValidateDoubleVoteReports::::new(), ); @@ -442,7 +442,7 @@ impl system::offchain::CreateSignedTransaction for Runtime } } -impl system::offchain::SigningTypes for Runtime { +impl frame_system::offchain::SigningTypes for Runtime { type Public = ::Signer; type Signature = Signature; } @@ -451,15 +451,15 @@ parameter_types! { pub storage OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } -impl offences::Trait for Runtime { +impl pallet_offences::Trait for Runtime { type Event = Event; - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); } -impl authority_discovery::Trait for Runtime {} +impl pallet_authority_discovery::Trait for Runtime {} parameter_types! { pub storage ParathreadDeposit: Balance = 5 * DOLLARS; @@ -499,14 +499,14 @@ impl claims::Trait for Runtime { type Event = Event; type VestingSchedule = Vesting; type Prefix = Prefix; - type MoveClaimOrigin = system::EnsureRoot; + type MoveClaimOrigin = frame_system::EnsureRoot; } parameter_types! { pub storage MinVestedTransfer: Balance = 100 * DOLLARS; } -impl vesting::Trait for Runtime { +impl pallet_vesting::Trait for Runtime { type Event = Event; type Currency = Balances; type BlockNumberToBalance = ConvertInto; @@ -514,7 +514,7 @@ impl vesting::Trait for Runtime { type WeightInfo = (); } -impl sudo::Trait for Runtime { +impl pallet_sudo::Trait for Runtime { type Event = Event; type Call = Call; } @@ -526,25 +526,25 @@ construct_runtime! { UncheckedExtrinsic = UncheckedExtrinsic { // Basic stuff; balances is uncallable initially. - System: system::{Module, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage}, + System: frame_system::{Module, Call, Storage, Config, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage}, // Must be before session. - Babe: babe::{Module, Call, Storage, Config, Inherent}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent}, - Timestamp: timestamp::{Module, Call, Storage, Inherent}, - Indices: indices::{Module, Call, Storage, Config, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - TransactionPayment: transaction_payment::{Module, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, + Indices: pallet_indices::{Module, Call, Storage, Config, Event}, + Balances: pallet_balances::{Module, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Module, Storage}, // Consensus support. - Authorship: authorship::{Module, Call, Storage}, - Staking: staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - Offences: offences::{Module, Call, Storage, Event}, + Authorship: pallet_authorship::{Module, Call, Storage}, + Staking: pallet_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + Offences: pallet_offences::{Module, Call, Storage, Event}, Historical: session_historical::{Module}, - Session: session::{Module, Call, Storage, Event, Config}, - Grandpa: grandpa::{Module, Call, Storage, Config, Event}, - AuthorityDiscovery: authority_discovery::{Module, Call, Config}, + Session: pallet_session::{Module, Call, Storage, Event, Config}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event}, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, // Claims. Usable initially. Claims: claims::{Module, Call, Storage, Event, Config, ValidateUnsigned}, @@ -557,10 +557,10 @@ construct_runtime! { Registrar: registrar::{Module, Call, Storage, Event, Config}, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: vesting::{Module, Call, Storage, Event, Config}, + Vesting: pallet_vesting::{Module, Call, Storage, Event, Config}, // Sudo. Last module. - Sudo: sudo::{Module, Call, Storage, Config, Event}, + Sudo: pallet_sudo::{Module, Call, Storage, Config, Event}, } } @@ -577,13 +577,13 @@ pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( RestrictFunctionality, - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckMortality, - system::CheckNonce, - system::CheckWeight, - transaction_payment::ChargeTransactionPayment::, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckMortality, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment::, registrar::LimitParathreadCommits, parachains::ValidateDoubleVoteReports, ); @@ -592,7 +592,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive, Runtime, AllModules>; +pub type Executive = frame_executive::Executive, Runtime, AllModules>; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -779,7 +779,7 @@ sp_api::impl_runtime_apis! { } } - impl system_rpc_runtime_api::AccountNonceApi for Runtime { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 3e1d10010556..739bbcc8eaad 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -26,45 +26,45 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -version = { package = "sp-version", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authority-discovery = { package = "pallet-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -authorship = { package = "pallet-authorship", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -collective = { package = "pallet-collective", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -democracy = { package = "pallet-democracy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -membership = { package = "pallet-membership", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -multisig = { package = "pallet-multisig", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -proxy = { package = "pallet-proxy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -recovery = { package = "pallet-recovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -scheduler = { package = "pallet-scheduler", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -society = { package = "pallet-society", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-finality-tracker = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-nicks = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-society = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" } -sudo = { package = "pallet-sudo", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -treasury = { package = "pallet-treasury", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -utility = { package = "pallet-utility", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -vesting = { package = "pallet-vesting", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true } @@ -93,7 +93,7 @@ no_std = [] only-staking = [] std = [ "authority-discovery-primitives/std", - "authority-discovery/std", + "pallet-authority-discovery/std", "bitvec/std", "primitives/std", "rustc-hex/std", @@ -108,46 +108,46 @@ std = [ "sp-std/std", "sp-io/std", "frame-support/std", - "authorship/std", - "balances/std", - "transaction-payment/std", - "transaction-payment-rpc-runtime-api/std", - "collective/std", - "elections-phragmen/std", - "democracy/std", - "executive/std", - "finality-tracker/std", - "grandpa/std", - "identity/std", - "im-online/std", - "indices/std", - "membership/std", - "multisig/std", - "nicks/std", - "offences/std", - "proxy/std", - "recovery/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-collective/std", + "pallet-elections-phragmen/std", + "pallet-democracy/std", + "frame-executive/std", + "pallet-finality-tracker/std", + "pallet-grandpa/std", + "pallet-identity/std", + "pallet-im-online/std", + "pallet-indices/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-nicks/std", + "pallet-offences/std", + "pallet-proxy/std", + "pallet-recovery/std", "sp-runtime/std", "sp-staking/std", - "scheduler/std", - "session/std", - "society/std", - "staking/std", - "sudo/std", - "system/std", - "system_rpc_runtime_api/std", - "timestamp/std", - "treasury/std", - "version/std", - "utility/std", - "vesting/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-society/std", + "pallet-staking/std", + "pallet-sudo/std", + "frame-system/std", + "frame-system-rpc-runtime-api/std", + "pallet-timestamp/std", + "pallet-treasury/std", + "sp-version/std", + "pallet-utility/std", + "pallet-vesting/std", "serde_derive", "serde/std", "log", - "babe/std", + "pallet-babe/std", "babe-primitives/std", "sp-session/std", - "randomness-collective-flip/std", + "pallet-randomness-collective-flip/std", "runtime-common/std", ] runtime-benchmarks = [ @@ -155,21 +155,21 @@ runtime-benchmarks = [ "frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system-benchmarking", - "system/runtime-benchmarks", + "frame-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "balances/runtime-benchmarks", - "collective/runtime-benchmarks", - "democracy/runtime-benchmarks", - "elections-phragmen/runtime-benchmarks", - "identity/runtime-benchmarks", - "im-online/runtime-benchmarks", - "scheduler/runtime-benchmarks", - "society/runtime-benchmarks", - "staking/runtime-benchmarks", - "timestamp/runtime-benchmarks", - "treasury/runtime-benchmarks", - "utility/runtime-benchmarks", - "vesting/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-democracy/runtime-benchmarks", + "pallet-elections-phragmen/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-im-online/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-society/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-vesting/runtime-benchmarks", "pallet-offences-benchmarking", "pallet-session-benchmarking", # uncomment when it is made optional again diff --git a/runtime/westend/src/constants.rs b/runtime/westend/src/constants.rs index f59a384fba8b..6fb7e934e1f1 100644 --- a/runtime/westend/src/constants.rs +++ b/runtime/westend/src/constants.rs @@ -61,7 +61,7 @@ pub mod fee { /// node's balance type. /// /// This should typically create a mapping between the following ranges: - /// - [0, system::MaximumBlockWeight] + /// - [0, frame_system::MaximumBlockWeight] /// - [Balance::min, Balance::max] /// /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 7e2cb3a71d32..0c11900bea8c 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -44,10 +44,10 @@ use sp_runtime::{ }; #[cfg(feature = "runtime-benchmarks")] use sp_runtime::RuntimeString; -use version::RuntimeVersion; -use grandpa::{AuthorityId as GrandpaId, fg_primitives}; +use sp_version::RuntimeVersion; +use pallet_grandpa::{AuthorityId as GrandpaId, fg_primitives}; #[cfg(any(feature = "std", test))] -use version::NativeVersion; +use sp_version::NativeVersion; use sp_core::OpaqueMetadata; use sp_staking::SessionIndex; use frame_support::{ @@ -55,18 +55,18 @@ use frame_support::{ traits::{KeyOwnerProofSystem, Randomness, Filter, InstanceFilter}, weights::Weight, }; -use im_online::sr25519::AuthorityId as ImOnlineId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; -use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; -use session::historical as session_historical; -use system::{EnsureRoot, EnsureSignedBy, EnsureOneOf}; +use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo; +use pallet_session::historical as session_historical; +use frame_system::{EnsureRoot, EnsureSignedBy, EnsureOneOf}; #[cfg(feature = "std")] -pub use staking::StakerStatus; +pub use pallet_staking::StakerStatus; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -pub use timestamp::Call as TimestampCall; -pub use balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +pub use pallet_balances::Call as BalancesCall; pub use attestations::{Call as AttestationsCall, MORE_ATTESTATIONS_IDENTIFIER}; pub use parachains::Call as ParachainsCall; @@ -91,7 +91,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, #[cfg(feature = "disable-runtime-api")] - apis: version::create_apis_vec![[]], + apis: sp_version::create_apis_vec![[]], transaction_version: 2, }; @@ -116,7 +116,7 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } -impl system::Trait for Runtime { +impl frame_system::Trait for Runtime { type BaseCallFilter = BaseFilter; type Origin = Origin; type Call = Call; @@ -138,13 +138,13 @@ impl system::Trait for Runtime { type AvailableBlockRatio = AvailableBlockRatio; type Version = Version; type ModuleToIndex = ModuleToIndex; - type AccountData = balances::AccountData; + type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } -impl scheduler::Trait for Runtime { +impl pallet_scheduler::Trait for Runtime { type Event = Event; type Origin = Origin; type PalletsOrigin = OriginCaller; @@ -159,34 +159,34 @@ parameter_types! { pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; } -impl babe::Trait for Runtime { +impl pallet_babe::Trait for Runtime { type EpochDuration = EpochDuration; type ExpectedBlockTime = ExpectedBlockTime; // session module is the trigger - type EpochChangeTrigger = babe::ExternalTrigger; + type EpochChangeTrigger = pallet_babe::ExternalTrigger; type KeyOwnerProofSystem = Historical; type KeyOwnerProof = >::Proof; type KeyOwnerIdentification = >::IdentificationTuple; type HandleEquivocation = - babe::EquivocationHandler; + pallet_babe::EquivocationHandler; } parameter_types! { pub const IndexDeposit: Balance = 1 * DOLLARS; } -impl indices::Trait for Runtime { +impl pallet_indices::Trait for Runtime { type AccountIndex = AccountIndex; type Currency = Balances; type Deposit = IndexDeposit; @@ -198,20 +198,20 @@ parameter_types! { pub const ExistentialDeposit: Balance = 1 * CENTS; } -impl balances::Trait for Runtime { +impl pallet_balances::Trait for Runtime { type Balance = Balance; type DustRemoval = (); type Event = Event; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = weights::balances::WeightInfo; + type WeightInfo = weights::pallet_balances::WeightInfo; } parameter_types! { pub const TransactionByteFee: Balance = 10 * MILLICENTS; } -impl transaction_payment::Trait for Runtime { +impl pallet_transaction_payment::Trait for Runtime { type Currency = Balances; type OnTransactionPayment = ToAuthor; type TransactionByteFee = TransactionByteFee; @@ -222,7 +222,7 @@ impl transaction_payment::Trait for Runtime { parameter_types! { pub const MinimumPeriod: u64 = SLOT_DURATION / 2; } -impl timestamp::Trait for Runtime { +impl pallet_timestamp::Trait for Runtime { type Moment = u64; type OnTimestampSet = Babe; type MinimumPeriod = MinimumPeriod; @@ -234,8 +234,8 @@ parameter_types! { } // TODO: substrate#2986 implement this properly -impl authorship::Trait for Runtime { - type FindAuthor = session::FindAccountFromAuthorIndex; +impl pallet_authorship::Trait for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; type UncleGenerations = UncleGenerations; type FilterUncle = (); type EventHandler = (Staking, ImOnline); @@ -260,22 +260,22 @@ parameter_types! { pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17); } -impl session::Trait for Runtime { +impl pallet_session::Trait for Runtime { type Event = Event; type ValidatorId = AccountId; - type ValidatorIdOf = staking::StashOf; + type ValidatorIdOf = pallet_staking::StashOf; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - type SessionManager = session::historical::NoteHistoricalRoot; + type SessionManager = pallet_session::historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisabledValidatorsThreshold = DisabledValidatorsThreshold; type WeightInfo = (); } -impl session::historical::Trait for Runtime { - type FullIdentification = staking::Exposure; - type FullIdentificationOf = staking::ExposureOf; +impl pallet_session::historical::Trait for Runtime { + type FullIdentification = pallet_staking::Exposure; + type FullIdentificationOf = pallet_staking::ExposureOf; } pallet_staking_reward_curve::build! { @@ -293,9 +293,9 @@ parameter_types! { // Six sessions in an era (6 hours). pub const SessionsPerEra: SessionIndex = 6; // 28 eras for unbonding (7 days). - pub const BondingDuration: staking::EraIndex = 28; + pub const BondingDuration: pallet_staking::EraIndex = 28; // 27 eras in which slashes can be cancelled (slightly less than 7 days). - pub const SlashDeferDuration: staking::EraIndex = 27; + pub const SlashDeferDuration: pallet_staking::EraIndex = 27; pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; // quarter of the last session will be for election. @@ -304,7 +304,7 @@ parameter_types! { pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000); } -impl staking::Trait for Runtime { +impl pallet_staking::Trait for Runtime { type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = CurrencyToVoteHandler; @@ -345,15 +345,15 @@ parameter_types! { pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get(); } -impl offences::Trait for Runtime { +impl pallet_offences::Trait for Runtime { type Event = Event; - type IdentificationTuple = session::historical::IdentificationTuple; + type IdentificationTuple = pallet_session::historical::IdentificationTuple; type OnOffenceHandler = Staking; type WeightSoftLimit = OffencesWeightSoftLimit; type WeightInfo = (); } -impl authority_discovery::Trait for Runtime {} +impl pallet_authority_discovery::Trait for Runtime {} parameter_types! { pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_BLOCKS as _; @@ -364,7 +364,7 @@ parameter_types! { pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value(); } -impl im_online::Trait for Runtime { +impl pallet_im_online::Trait for Runtime { type AuthorityId = ImOnlineId; type Event = Event; type ReportUnresponsiveness = Offences; @@ -373,7 +373,7 @@ impl im_online::Trait for Runtime { type WeightInfo = (); } -impl grandpa::Trait for Runtime { +impl pallet_grandpa::Trait for Runtime { type Event = Event; type Call = Call; @@ -387,15 +387,15 @@ impl grandpa::Trait for Runtime { GrandpaId, )>>::IdentificationTuple; - type HandleEquivocation = grandpa::EquivocationHandler; + type HandleEquivocation = pallet_grandpa::EquivocationHandler; } parameter_types! { - pub WindowSize: BlockNumber = finality_tracker::DEFAULT_WINDOW_SIZE.into(); - pub ReportLatency: BlockNumber = finality_tracker::DEFAULT_REPORT_LATENCY.into(); + pub WindowSize: BlockNumber = pallet_finality_tracker::DEFAULT_WINDOW_SIZE.into(); + pub ReportLatency: BlockNumber = pallet_finality_tracker::DEFAULT_REPORT_LATENCY.into(); } -impl finality_tracker::Trait for Runtime { +impl pallet_finality_tracker::Trait for Runtime { type OnFinalizationStalled = (); type WindowSize = WindowSize; type ReportLatency = ReportLatency; @@ -436,7 +436,7 @@ impl parachains::Trait for Runtime { type SlashPeriod = SlashPeriod; type Proof = sp_session::MembershipProof; - type KeyOwnerProofSystem = session::historical::Module; + type KeyOwnerProofSystem = pallet_session::historical::Module; type IdentificationTuple = )>>::IdentificationTuple; type ReportOffence = Offences; type BlockHashConversion = sp_runtime::traits::Identity; @@ -444,14 +444,14 @@ impl parachains::Trait for Runtime { /// Submits a transaction with the node's public and signature type. Adheres to the signed extension /// format of the chain. -impl system::offchain::CreateSignedTransaction for Runtime where +impl frame_system::offchain::CreateSignedTransaction for Runtime where Call: From, { - fn create_transaction>( + fn create_transaction>( call: Call, public: ::Signer, account: AccountId, - nonce: ::Index, + nonce: ::Index, ) -> Option<(Call, ::SignaturePayload)> { // take the biggest period possible. let period = BlockHashCount::get() @@ -466,13 +466,13 @@ impl system::offchain::CreateSignedTransaction for Runtime .saturating_sub(1); let tip = 0; let extra: SignedExtra = ( - system::CheckSpecVersion::::new(), - system::CheckTxVersion::::new(), - system::CheckGenesis::::new(), - system::CheckMortality::::from(generic::Era::mortal(period, current_block)), - system::CheckNonce::::from(nonce), - system::CheckWeight::::new(), - transaction_payment::ChargeTransactionPayment::::from(tip), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckMortality::::from(generic::Era::mortal(period, current_block)), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(tip), registrar::LimitParathreadCommits::::new(), parachains::ValidateDoubleVoteReports::::new(), ); @@ -487,12 +487,12 @@ impl system::offchain::CreateSignedTransaction for Runtime } } -impl system::offchain::SigningTypes for Runtime { +impl frame_system::offchain::SigningTypes for Runtime { type Public = ::Signer; type Signature = Signature; } -impl system::offchain::SendTransactionTypes for Runtime where +impl frame_system::offchain::SendTransactionTypes for Runtime where Call: From, { type OverarchingCall = Call; @@ -525,7 +525,7 @@ parameter_types! { pub const MaxRegistrars: u32 = 20; } -impl identity::Trait for Runtime { +impl pallet_identity::Trait for Runtime { type Event = Event; type Currency = Balances; type Slashed = (); @@ -535,12 +535,12 @@ impl identity::Trait for Runtime { type MaxSubAccounts = MaxSubAccounts; type MaxAdditionalFields = MaxAdditionalFields; type MaxRegistrars = MaxRegistrars; - type RegistrarOrigin = system::EnsureRoot; - type ForceOrigin = system::EnsureRoot; + type RegistrarOrigin = frame_system::EnsureRoot; + type ForceOrigin = frame_system::EnsureRoot; type WeightInfo = (); } -impl utility::Trait for Runtime { +impl pallet_utility::Trait for Runtime { type Event = Event; type Call = Call; type WeightInfo = (); @@ -554,7 +554,7 @@ parameter_types! { pub const MaxSignatories: u16 = 100; } -impl multisig::Trait for Runtime { +impl pallet_multisig::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -571,7 +571,7 @@ parameter_types! { pub const RecoveryDeposit: Balance = 5 * DOLLARS; } -impl recovery::Trait for Runtime { +impl pallet_recovery::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -585,7 +585,7 @@ parameter_types! { pub const MinVestedTransfer: Balance = 100 * DOLLARS; } -impl vesting::Trait for Runtime { +impl pallet_vesting::Trait for Runtime { type Event = Event; type Currency = Balances; type BlockNumberToBalance = ConvertInto; @@ -593,7 +593,7 @@ impl vesting::Trait for Runtime { type WeightInfo = (); } -impl sudo::Trait for Runtime { +impl pallet_sudo::Trait for Runtime { type Event = Event; type Call = Call; } @@ -624,9 +624,9 @@ impl InstanceFilter for ProxyType { Call::System(..) | Call::Babe(..) | Call::Timestamp(..) | - Call::Indices(indices::Call::claim(..)) | - Call::Indices(indices::Call::free(..)) | - Call::Indices(indices::Call::freeze(..)) | + Call::Indices(pallet_indices::Call::claim(..)) | + Call::Indices(pallet_indices::Call::free(..)) | + Call::Indices(pallet_indices::Call::freeze(..)) | // Specifically omitting Indices `transfer`, `force_transfer` // Specifically omitting the entire Balances pallet Call::Authorship(..) | @@ -642,15 +642,15 @@ impl InstanceFilter for ProxyType { Call::Registrar(..) | Call::Utility(..) | Call::Identity(..) | - Call::Recovery(recovery::Call::as_recovered(..)) | - Call::Recovery(recovery::Call::vouch_recovery(..)) | - Call::Recovery(recovery::Call::claim_recovery(..)) | - Call::Recovery(recovery::Call::close_recovery(..)) | - Call::Recovery(recovery::Call::remove_recovery(..)) | - Call::Recovery(recovery::Call::cancel_recovered(..)) | + Call::Recovery(pallet_recovery::Call::as_recovered(..)) | + Call::Recovery(pallet_recovery::Call::vouch_recovery(..)) | + Call::Recovery(pallet_recovery::Call::claim_recovery(..)) | + Call::Recovery(pallet_recovery::Call::close_recovery(..)) | + Call::Recovery(pallet_recovery::Call::remove_recovery(..)) | + Call::Recovery(pallet_recovery::Call::cancel_recovered(..)) | // Specifically omitting Recovery `create_recovery`, `initiate_recovery` - Call::Vesting(vesting::Call::vest(..)) | - Call::Vesting(vesting::Call::vest_other(..)) | + Call::Vesting(pallet_vesting::Call::vest(..)) | + Call::Vesting(pallet_vesting::Call::vest_other(..)) | // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` Call::Scheduler(..) | // Specifically omitting Sudo pallet @@ -661,13 +661,13 @@ impl InstanceFilter for ProxyType { Call::Staking(..) | Call::Utility(..) ), ProxyType::SudoBalances => match c { - Call::Sudo(sudo::Call::sudo(ref x)) => matches!(x.as_ref(), &Call::Balances(..)), + Call::Sudo(pallet_sudo::Call::sudo(ref x)) => matches!(x.as_ref(), &Call::Balances(..)), Call::Utility(..) => true, _ => false, }, ProxyType::IdentityJudgement => matches!(c, - Call::Identity(identity::Call::provide_judgement(..)) - | Call::Utility(utility::Call::batch(..)) + Call::Identity(pallet_identity::Call::provide_judgement(..)) + | Call::Utility(pallet_utility::Call::batch(..)) ) } } @@ -682,7 +682,7 @@ impl InstanceFilter for ProxyType { } } -impl proxy::Trait for Runtime { +impl pallet_proxy::Trait for Runtime { type Event = Event; type Call = Call; type Currency = Balances; @@ -740,27 +740,27 @@ construct_runtime! { UncheckedExtrinsic = UncheckedExtrinsic { // Basic stuff; balances is uncallable initially. - System: system::{Module, Call, Storage, Config, Event}, - RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage}, + System: frame_system::{Module, Call, Storage, Config, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage}, // Must be before session. - Babe: babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, + Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, - Timestamp: timestamp::{Module, Call, Storage, Inherent}, - Indices: indices::{Module, Call, Storage, Config, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - TransactionPayment: transaction_payment::{Module, Storage}, + Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, + Indices: pallet_indices::{Module, Call, Storage, Config, Event}, + Balances: pallet_balances::{Module, Call, Storage, Config, Event}, + TransactionPayment: pallet_transaction_payment::{Module, Storage}, // Consensus support. - Authorship: authorship::{Module, Call, Storage}, - Staking: staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - Offences: offences::{Module, Call, Storage, Event}, + Authorship: pallet_authorship::{Module, Call, Storage}, + Staking: pallet_staking::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + Offences: pallet_offences::{Module, Call, Storage, Event}, Historical: session_historical::{Module}, - Session: session::{Module, Call, Storage, Event, Config}, - FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent}, - Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, - ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, - AuthorityDiscovery: authority_discovery::{Module, Call, Config}, + Session: pallet_session::{Module, Call, Storage, Event, Config}, + FinalityTracker: pallet_finality_tracker::{Module, Call, Storage, Inherent}, + Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned}, + ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, + AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config}, // Parachains stuff; slots are disabled (no auctions initially). The rest are safe as they // have no public dispatchables. @@ -769,28 +769,28 @@ construct_runtime! { Registrar: registrar::{Module, Call, Storage, Event, Config}, // Utility module. - Utility: utility::{Module, Call, Event}, + Utility: pallet_utility::{Module, Call, Event}, // Less simple identity module. - Identity: identity::{Module, Call, Storage, Event}, + Identity: pallet_identity::{Module, Call, Storage, Event}, // Social recovery module. - Recovery: recovery::{Module, Call, Storage, Event}, + Recovery: pallet_recovery::{Module, Call, Storage, Event}, // Vesting. Usable initially, but removed once all vesting is finished. - Vesting: vesting::{Module, Call, Storage, Event, Config}, + Vesting: pallet_vesting::{Module, Call, Storage, Event, Config}, // System scheduler. - Scheduler: scheduler::{Module, Call, Storage, Event}, + Scheduler: pallet_scheduler::{Module, Call, Storage, Event}, // Sudo. - Sudo: sudo::{Module, Call, Storage, Event, Config}, + Sudo: pallet_sudo::{Module, Call, Storage, Event, Config}, // Proxy module. Late addition. - Proxy: proxy::{Module, Call, Storage, Event}, + Proxy: pallet_proxy::{Module, Call, Storage, Event}, // Multisig module. Late addition. - Multisig: multisig::{Module, Call, Storage, Event}, + Multisig: pallet_multisig::{Module, Call, Storage, Event}, // Purchase module. Late addition. Purchase: purchase::{Module, Call, Storage, Event}, @@ -809,13 +809,13 @@ pub type SignedBlock = generic::SignedBlock; pub type BlockId = generic::BlockId; /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( - system::CheckSpecVersion, - system::CheckTxVersion, - system::CheckGenesis, - system::CheckMortality, - system::CheckNonce, - system::CheckWeight, - transaction_payment::ChargeTransactionPayment, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckMortality, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, registrar::LimitParathreadCommits, parachains::ValidateDoubleVoteReports, ); @@ -824,7 +824,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = executive::Executive, Runtime, AllModules>; +pub type Executive = frame_executive::Executive, Runtime, AllModules>; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -1027,13 +1027,13 @@ sp_api::impl_runtime_apis! { } } - impl system_rpc_runtime_api::AccountNonceApi for Runtime { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } - impl transaction_payment_rpc_runtime_api::TransactionPaymentApi< + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, > for Runtime { @@ -1095,21 +1095,20 @@ sp_api::impl_runtime_apis! { extra, ); - add_benchmark!(params, batches, balances,Balances); - add_benchmark!(params, batches, identity,Identity); - add_benchmark!(params, batches, im_online,ImOnline); - add_benchmark!(params, batches, offences,OffencesBench::); - add_benchmark!(params, batches, scheduler, Scheduler); - add_benchmark!(params, batches, session, SessionBench::); - add_benchmark!(params, batches, staking, Staking); - add_benchmark!(params, batches, system, SystemBench::); - add_benchmark!(params, batches, timestamp, Timestamp); - add_benchmark!(params, batches, utility, Utility); - add_benchmark!(params, batches, vesting, Vesting); + add_benchmark!(params, batches, pallet_balances, Balances); + add_benchmark!(params, batches, pallet_identity, Identity); + add_benchmark!(params, batches, pallet_im_online, ImOnline); + add_benchmark!(params, batches, pallet_offences, OffencesBench::); + add_benchmark!(params, batches, pallet_scheduler, Scheduler); + add_benchmark!(params, batches, pallet_session, SessionBench::); + add_benchmark!(params, batches, pallet_staking, Staking); + add_benchmark!(params, batches, frame_system, SystemBench::); + add_benchmark!(params, batches, pallet_timestamp, Timestamp); + add_benchmark!(params, batches, pallet_utility, Utility); + add_benchmark!(params, batches, pallet_vesting, Vesting); if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } Ok(batches) } } } - diff --git a/runtime/westend/src/weights/mod.rs b/runtime/westend/src/weights/mod.rs index 75cabca0c6e6..b94314e33942 100644 --- a/runtime/westend/src/weights/mod.rs +++ b/runtime/westend/src/weights/mod.rs @@ -16,4 +16,4 @@ /// A collection of weight modules used for pallets in the runtime. -pub mod balances; +pub mod pallet_balances; diff --git a/runtime/westend/src/weights/balances.rs b/runtime/westend/src/weights/pallet_balances.rs similarity index 97% rename from runtime/westend/src/weights/balances.rs rename to runtime/westend/src/weights/pallet_balances.rs index bc2f3ac18af2..53431ba48f2f 100644 --- a/runtime/westend/src/weights/balances.rs +++ b/runtime/westend/src/weights/pallet_balances.rs @@ -18,7 +18,7 @@ use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight}; pub struct WeightInfo; -impl balances::WeightInfo for WeightInfo { +impl pallet_balances::WeightInfo for WeightInfo { fn transfer() -> Weight { (65949000 as Weight) .saturating_add(DbWeight::get().reads(1 as Weight)) diff --git a/service/Cargo.toml b/service/Cargo.toml index 858d1e415c14..c5dd68e57f34 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -45,14 +45,14 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" } -im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "master" } +pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } codec = { package = "parity-scale-codec", version = "1.3.4" } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/service/src/chain_spec.rs b/service/src/chain_spec.rs index 7057aca5eb44..580d00b9464e 100644 --- a/service/src/chain_spec.rs +++ b/service/src/chain_spec.rs @@ -33,7 +33,7 @@ use telemetry::TelemetryEndpoints; use hex_literal::hex; use babe_primitives::AuthorityId as BabeId; use grandpa::AuthorityId as GrandpaId; -use im_online::sr25519::{AuthorityId as ImOnlineId}; +use pallet_im_online::sr25519::{AuthorityId as ImOnlineId}; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use pallet_staking::Forcing; @@ -153,27 +153,27 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene const STASH: u128 = 100 * DOTS; polkadot::GenesisConfig { - system: Some(polkadot::SystemConfig { + frame_system: Some(polkadot::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(polkadot::BalancesConfig { + pallet_balances: Some(polkadot::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(polkadot::IndicesConfig { + pallet_indices: Some(polkadot::IndicesConfig { indices: vec![], }), - session: Some(polkadot::SessionConfig { + pallet_session: Some(polkadot::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), polkadot_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(polkadot::StakingConfig { + pallet_staking: Some(polkadot::StakingConfig { validator_count: 50, minimum_validator_count: 4, stakers: initial_authorities @@ -185,21 +185,21 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(Default::default()), - collective_Instance1: Some(polkadot::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(Default::default()), + pallet_collective_Instance1: Some(polkadot::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(polkadot::ParachainsConfig { @@ -213,7 +213,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene claims: vec![], vesting: vec![], }), - vesting: Some(polkadot::VestingConfig { + pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![], }), } @@ -305,27 +305,27 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi const STASH: u128 = 100 * WND; westend::GenesisConfig { - system: Some(westend::SystemConfig { + frame_system: Some(westend::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(westend::BalancesConfig { + pallet_balances: Some(westend::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(westend::IndicesConfig { + pallet_indices: Some(westend::IndicesConfig { indices: vec![], }), - session: Some(westend::SessionConfig { + pallet_session: Some(westend::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), westend_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(westend::StakingConfig { + pallet_staking: Some(westend::StakingConfig { validator_count: 50, minimum_validator_count: 4, stakers: initial_authorities @@ -337,10 +337,10 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(westend::AuthorityDiscoveryConfig { + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(westend::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(westend::ParachainsConfig { @@ -350,10 +350,10 @@ fn westend_staging_testnet_config_genesis(wasm_binary: &[u8]) -> westend::Genesi parachains: vec![], _phdata: Default::default(), }), - vesting: Some(westend::VestingConfig { + pallet_vesting: Some(westend::VestingConfig { vesting: vec![], }), - sudo: Some(westend::SudoConfig { + pallet_sudo: Some(westend::SudoConfig { key: endowed_accounts[0].clone(), }), } @@ -508,30 +508,30 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime:: const STASH: u128 = 100 * ROC; rococo_runtime::GenesisConfig { - system: Some(rococo_runtime::SystemConfig { + frame_system: Some(rococo_runtime::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(rococo_runtime::BalancesConfig { + pallet_balances: Some(rococo_runtime::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(rococo_runtime::IndicesConfig { + pallet_indices: Some(rococo_runtime::IndicesConfig { indices: vec![], }), - session: Some(rococo_runtime::SessionConfig { + pallet_session: Some(rococo_runtime::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), rococo_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(rococo_runtime::AuthorityDiscoveryConfig { + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(rococo_runtime::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(rococo_runtime::ParachainsConfig { @@ -541,10 +541,10 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime:: parachains: vec![], _phdata: Default::default(), }), - vesting: Some(rococo_runtime::VestingConfig { + pallet_vesting: Some(rococo_runtime::VestingConfig { vesting: vec![], }), - sudo: Some(rococo_runtime::SudoConfig { + pallet_sudo: Some(rococo_runtime::SudoConfig { key: endowed_accounts[0].clone(), }), } @@ -636,27 +636,27 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC const STASH: u128 = 100 * KSM; kusama::GenesisConfig { - system: Some(kusama::SystemConfig { + frame_system: Some(kusama::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - balances: Some(kusama::BalancesConfig { + pallet_balances: Some(kusama::BalancesConfig { balances: endowed_accounts.iter() .map(|k: &AccountId| (k.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }), - indices: Some(kusama::IndicesConfig { + pallet_indices: Some(kusama::IndicesConfig { indices: vec![], }), - session: Some(kusama::SessionConfig { + pallet_session: Some(kusama::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), kusama_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(kusama::StakingConfig { + pallet_staking: Some(kusama::StakingConfig { validator_count: 50, minimum_validator_count: 4, stakers: initial_authorities @@ -668,21 +668,21 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(Default::default()), - collective_Instance1: Some(kusama::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(Default::default()), + pallet_collective_Instance1: Some(kusama::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(kusama::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(kusama::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(kusama::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(kusama::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(kusama::ParachainsConfig { @@ -696,7 +696,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC claims: vec![], vesting: vec![], }), - vesting: Some(kusama::VestingConfig { + pallet_vesting: Some(kusama::VestingConfig { vesting: vec![], }), } @@ -844,24 +844,24 @@ pub fn polkadot_testnet_genesis( const STASH: u128 = 100 * DOTS; polkadot::GenesisConfig { - system: Some(polkadot::SystemConfig { + frame_system: Some(polkadot::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(polkadot::IndicesConfig { + pallet_indices: Some(polkadot::IndicesConfig { indices: vec![], }), - balances: Some(polkadot::BalancesConfig { + pallet_balances: Some(polkadot::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(polkadot::SessionConfig { + pallet_session: Some(polkadot::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), polkadot_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(polkadot::StakingConfig { + pallet_staking: Some(polkadot::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities.iter() @@ -872,21 +872,21 @@ pub fn polkadot_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(polkadot::DemocracyConfig::default()), - collective_Instance1: Some(polkadot::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(polkadot::DemocracyConfig::default()), + pallet_collective_Instance1: Some(polkadot::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(polkadot::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(polkadot::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(polkadot::ParachainsConfig { @@ -900,7 +900,7 @@ pub fn polkadot_testnet_genesis( claims: vec![], vesting: vec![], }), - vesting: Some(polkadot::VestingConfig { + pallet_vesting: Some(polkadot::VestingConfig { vesting: vec![], }), } @@ -919,24 +919,24 @@ pub fn kusama_testnet_genesis( const STASH: u128 = 100 * KSM; kusama::GenesisConfig { - system: Some(kusama::SystemConfig { + frame_system: Some(kusama::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(kusama::IndicesConfig { + pallet_indices: Some(kusama::IndicesConfig { indices: vec![], }), - balances: Some(kusama::BalancesConfig { + pallet_balances: Some(kusama::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(kusama::SessionConfig { + pallet_session: Some(kusama::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), kusama_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(kusama::StakingConfig { + pallet_staking: Some(kusama::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities.iter() @@ -947,21 +947,21 @@ pub fn kusama_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - elections_phragmen: Some(Default::default()), - democracy: Some(kusama::DemocracyConfig::default()), - collective_Instance1: Some(kusama::CouncilConfig { + pallet_elections_phragmen: Some(Default::default()), + pallet_democracy: Some(kusama::DemocracyConfig::default()), + pallet_collective_Instance1: Some(kusama::CouncilConfig { members: vec![], phantom: Default::default(), }), - collective_Instance2: Some(kusama::TechnicalCommitteeConfig { + pallet_collective_Instance2: Some(kusama::TechnicalCommitteeConfig { members: vec![], phantom: Default::default(), }), - membership_Instance1: Some(Default::default()), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(kusama::AuthorityDiscoveryConfig { + pallet_membership_Instance1: Some(Default::default()), + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(kusama::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(kusama::ParachainsConfig { @@ -975,7 +975,7 @@ pub fn kusama_testnet_genesis( claims: vec![], vesting: vec![], }), - vesting: Some(kusama::VestingConfig { + pallet_vesting: Some(kusama::VestingConfig { vesting: vec![], }), } @@ -994,24 +994,24 @@ pub fn westend_testnet_genesis( const STASH: u128 = 100 * DOTS; westend::GenesisConfig { - system: Some(westend::SystemConfig { + frame_system: Some(westend::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(westend::IndicesConfig { + pallet_indices: Some(westend::IndicesConfig { indices: vec![], }), - balances: Some(westend::BalancesConfig { + pallet_balances: Some(westend::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(westend::SessionConfig { + pallet_session: Some(westend::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), westend_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - staking: Some(westend::StakingConfig { + pallet_staking: Some(westend::StakingConfig { minimum_validator_count: 1, validator_count: 2, stakers: initial_authorities.iter() @@ -1022,10 +1022,10 @@ pub fn westend_testnet_genesis( slash_reward_fraction: Perbill::from_percent(10), .. Default::default() }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(westend::AuthorityDiscoveryConfig { + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(westend::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(westend::ParachainsConfig { @@ -1035,10 +1035,10 @@ pub fn westend_testnet_genesis( parachains: vec![], _phdata: Default::default(), }), - vesting: Some(westend::VestingConfig { + pallet_vesting: Some(westend::VestingConfig { vesting: vec![], }), - sudo: Some(westend::SudoConfig { + pallet_sudo: Some(westend::SudoConfig { key: root_key, }), } @@ -1056,27 +1056,27 @@ pub fn rococo_testnet_genesis( const ENDOWMENT: u128 = 1_000_000 * DOTS; rococo_runtime::GenesisConfig { - system: Some(rococo_runtime::SystemConfig { + frame_system: Some(rococo_runtime::SystemConfig { code: wasm_binary.to_vec(), changes_trie_config: Default::default(), }), - indices: Some(rococo_runtime::IndicesConfig { + pallet_indices: Some(rococo_runtime::IndicesConfig { indices: vec![], }), - balances: Some(rococo_runtime::BalancesConfig { + pallet_balances: Some(rococo_runtime::BalancesConfig { balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), }), - session: Some(rococo_runtime::SessionConfig { + pallet_session: Some(rococo_runtime::SessionConfig { keys: initial_authorities.iter().map(|x| ( x.0.clone(), x.0.clone(), rococo_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()), )).collect::>(), }), - babe: Some(Default::default()), - grandpa: Some(Default::default()), - im_online: Some(Default::default()), - authority_discovery: Some(rococo_runtime::AuthorityDiscoveryConfig { + pallet_babe: Some(Default::default()), + pallet_grandpa: Some(Default::default()), + pallet_im_online: Some(Default::default()), + pallet_authority_discovery: Some(rococo_runtime::AuthorityDiscoveryConfig { keys: vec![], }), parachains: Some(rococo_runtime::ParachainsConfig { @@ -1086,10 +1086,10 @@ pub fn rococo_testnet_genesis( parachains: vec![], _phdata: Default::default(), }), - vesting: Some(rococo_runtime::VestingConfig { + pallet_vesting: Some(rococo_runtime::VestingConfig { vesting: vec![], }), - sudo: Some(rococo_runtime::SudoConfig { + pallet_sudo: Some(rococo_runtime::SudoConfig { key: root_key, }), } diff --git a/service/src/client.rs b/service/src/client.rs index 786d3b8fbabd..e7743e853075 100644 --- a/service/src/client.rs +++ b/service/src/client.rs @@ -31,7 +31,7 @@ pub trait RuntimeApiCollection: + grandpa_primitives::GrandpaApi + ParachainHost + sp_block_builder::BlockBuilder - + system_rpc_runtime_api::AccountNonceApi + + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi @@ -50,7 +50,7 @@ where + grandpa_primitives::GrandpaApi + ParachainHost + sp_block_builder::BlockBuilder - + system_rpc_runtime_api::AccountNonceApi + + frame_system_rpc_runtime_api::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi diff --git a/validation/Cargo.toml b/validation/Cargo.toml index 95d4643ada01..2c345b0c6260 100644 --- a/validation/Cargo.toml +++ b/validation/Cargo.toml @@ -32,7 +32,6 @@ block-builder = { package = "sc-block-builder", git = "https://github.com/parity trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master" } runtime_primitives = { package = "sp-runtime", git = "https://github.com/paritytech/substrate", branch = "master" } bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } -runtime_babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master" } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } keystore = { package = "sc-keystore", git = "https://github.com/paritytech/substrate", branch = "master" } prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" }