mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-26 07:41:15 +00:00
Unalias Substrate Imports (#1530)
* cargo.toml updates * session and system * more * more * more * more * more * fix * compiles * fix tests * fix more tests * fix mock * fix deleted space * Update validation/Cargo.toml Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update Cargo.lock * update rococo * remove unused warning * update add benchmarks * rename weight file * forgot a file * Update chain_spec.rs * Revert "remove unused warning" This reverts commit 4227cd0d1525286fb466dccb817564c9b37f8645. * fix merge Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Generated
-2
@@ -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",
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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,
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ pub trait RuntimeApiCollection:
|
||||
+ babe_primitives::BabeApi<Block>
|
||||
+ grandpa_primitives::GrandpaApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
@@ -102,7 +102,7 @@ where
|
||||
+ babe_primitives::BabeApi<Block>
|
||||
+ grandpa_primitives::GrandpaApi<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
|
||||
@@ -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::<Vec<_>>(),
|
||||
}),
|
||||
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 }),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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<T: staking::Trait> RewardAttestation for staking::Module<T> {
|
||||
impl<T: pallet_staking::Trait> RewardAttestation for pallet_staking::Module<T> {
|
||||
fn reward_immediate(validator_indices: impl IntoIterator<Item=u32>) {
|
||||
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<T: staking::Trait> RewardAttestation for staking::Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
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<Self::BlockNumber>;
|
||||
|
||||
@@ -130,7 +130,7 @@ decl_error! {
|
||||
|
||||
decl_module! {
|
||||
/// Parachain-attestations module.
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
/// Provide candidate receipts for parachains, in ascending order by id.
|
||||
|
||||
@@ -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<T> = <<T as Trait>::VestingSchedule as VestingSchedule<<T as system::Trait>::AccountId>>::Currency;
|
||||
type BalanceOf<T> = <CurrencyOf<T> as Currency<<T as system::Trait>::AccountId>>::Balance;
|
||||
type CurrencyOf<T> = <<T as Trait>::VestingSchedule as VestingSchedule<<T as frame_system::Trait>::AccountId>>::Currency;
|
||||
type BalanceOf<T> = <CurrencyOf<T> as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
|
||||
|
||||
/// Configuration trait.
|
||||
pub trait Trait: system::Trait {
|
||||
pub trait Trait: frame_system::Trait {
|
||||
/// The overarching event type.
|
||||
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
type VestingSchedule: VestingSchedule<Self::AccountId, Moment=Self::BlockNumber>;
|
||||
type Prefix: Get<&'static [u8]>;
|
||||
type MoveClaimOrigin: EnsureOrigin<Self::Origin>;
|
||||
@@ -130,7 +130,7 @@ impl sp_std::fmt::Debug for EcdsaSignature {
|
||||
decl_event!(
|
||||
pub enum Event<T> where
|
||||
Balance = BalanceOf<T>,
|
||||
AccountId = <T as system::Trait>::AccountId
|
||||
AccountId = <T as frame_system::Trait>::AccountId
|
||||
{
|
||||
/// Someone claimed some DOTs.
|
||||
Claimed(AccountId, EthereumAddress, Balance),
|
||||
@@ -194,7 +194,7 @@ decl_storage! {
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
/// The Prefix that is used in signed Ethereum messages for this network
|
||||
@@ -539,10 +539,10 @@ impl<T: Trait> sp_runtime::traits::ValidateUnsigned for Module<T> {
|
||||
/// otherwise free to place on chain.
|
||||
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
|
||||
pub struct PrevalidateAttests<T: Trait + Send + Sync>(sp_std::marker::PhantomData<T>) where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>;
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>;
|
||||
|
||||
impl<T: Trait + Send + Sync> Debug for PrevalidateAttests<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
#[cfg(feature = "std")]
|
||||
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
|
||||
@@ -556,7 +556,7 @@ impl<T: Trait + Send + Sync> Debug for PrevalidateAttests<T> where
|
||||
}
|
||||
|
||||
impl<T: Trait + Send + Sync> PrevalidateAttests<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
/// Create new `SignedExtension` to check runtime version.
|
||||
pub fn new() -> Self {
|
||||
@@ -565,10 +565,10 @@ impl<T: Trait + Send + Sync> PrevalidateAttests<T> where
|
||||
}
|
||||
|
||||
impl<T: Trait + Send + Sync> SignedExtension for PrevalidateAttests<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
type AccountId = T::AccountId;
|
||||
type Call = <T as system::Trait>::Call;
|
||||
type Call = <T as frame_system::Trait>::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<u64>;
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
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<Six, u64>;
|
||||
type MoveClaimOrigin = frame_system::EnsureSignedBy<Six, u64>;
|
||||
}
|
||||
type System = system::Module<Test>;
|
||||
type Balances = balances::Module<Test>;
|
||||
type Vesting = vesting::Module<Test>;
|
||||
type System = frame_system::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
type Vesting = pallet_vesting::Module<Test>;
|
||||
type Claims = Module<Test>;
|
||||
|
||||
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::<Test>().unwrap();
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
// We use default for brevity, but you can configure as desired if needed.
|
||||
balances::GenesisConfig::<Test>::default().assimilate_storage(&mut t).unwrap();
|
||||
pallet_balances::GenesisConfig::<Test>::default().assimilate_storage(&mut t).unwrap();
|
||||
GenesisConfig::<Test>{
|
||||
claims: vec![
|
||||
(eth(&alice()), 100, None, None),
|
||||
@@ -982,7 +982,7 @@ mod tests {
|
||||
// Make sure we can not transfer the vested balance.
|
||||
assert_err!(
|
||||
<Balances as Currency<_>>::transfer(&69, &80, 180, ExistenceRequirement::AllowDeath),
|
||||
balances::Error::<Test, _>::LiquidityRestrictions,
|
||||
pallet_balances::Error::<Test, _>::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;
|
||||
|
||||
@@ -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<T> =
|
||||
<<T as slots::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
|
||||
<<T as slots::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
|
||||
#[allow(dead_code)]
|
||||
pub type NegativeImbalanceOf<T> =
|
||||
<<T as slots::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
|
||||
<<T as slots::Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
|
||||
|
||||
pub trait Trait: slots::Trait {
|
||||
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
|
||||
/// ModuleID for the crowdfund module. An appropriate value could be ```ModuleId(*b"py/cfund")```
|
||||
type ModuleId: Get<ModuleId>;
|
||||
@@ -184,7 +184,7 @@ decl_storage! {
|
||||
|
||||
decl_event! {
|
||||
pub enum Event<T> where
|
||||
<T as system::Trait>::AccountId,
|
||||
<T as frame_system::Trait>::AccountId,
|
||||
Balance = BalanceOf<T>,
|
||||
{
|
||||
Created(FundIndex),
|
||||
@@ -244,7 +244,7 @@ decl_error! {
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
const ModuleId: ModuleId = T::ModuleId::get();
|
||||
@@ -263,7 +263,7 @@ decl_module! {
|
||||
|
||||
ensure!(first_slot < last_slot, Error::<T>::LastSlotBeforeFirstSlot);
|
||||
ensure!(last_slot <= first_slot + 3.into(), Error::<T>::LastSlotTooFarInFuture);
|
||||
ensure!(end > <system::Module<T>>::block_number(), Error::<T>::CannotEndInPast);
|
||||
ensure!(end > <frame_system::Module<T>>::block_number(), Error::<T>::CannotEndInPast);
|
||||
|
||||
let deposit = T::SubmissionDeposit::get();
|
||||
let transfer = WithdrawReason::Transfer.into();
|
||||
@@ -306,7 +306,7 @@ decl_module! {
|
||||
ensure!(fund.raised <= fund.cap, Error::<T>::CapExceeded);
|
||||
|
||||
// Make sure crowdfund has not ended
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
ensure!(fund.end > now, Error::<T>::ContributionPeriodOver);
|
||||
|
||||
T::Currency::transfer(&who, &Self::fund_account_id(index), value, AllowDeath)?;
|
||||
@@ -394,7 +394,7 @@ decl_module! {
|
||||
ensure!(fund.parachain.is_none(), Error::<T>::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();
|
||||
<slots::Module<T>>::fix_deploy_data(
|
||||
fund_origin,
|
||||
index,
|
||||
@@ -423,7 +423,7 @@ decl_module! {
|
||||
ensure!(T::Currency::free_balance(&account) >= fund.raised, Error::<T>::FundsNotReturned);
|
||||
|
||||
// This fund just ended. Withdrawal period begins.
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
fund.end = now;
|
||||
|
||||
<Funds<T>>::insert(index, &fund);
|
||||
@@ -438,7 +438,7 @@ decl_module! {
|
||||
|
||||
let mut fund = Self::funds(index).ok_or(Error::<T>::InvalidFundIndex)?;
|
||||
ensure!(fund.parachain.is_none(), Error::<T>::FundNotRetired);
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
|
||||
// `fund.end` can represent the end of a failed crowdsale or the beginning of retirement
|
||||
ensure!(now >= fund.end, Error::<T>::FundNotEnded);
|
||||
@@ -469,7 +469,7 @@ decl_module! {
|
||||
|
||||
let fund = Self::funds(index).ok_or(Error::<T>::InvalidFundIndex)?;
|
||||
ensure!(fund.parachain.is_none(), Error::<T>::HasActiveParachain);
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
ensure!(
|
||||
now >= fund.end.saturating_add(T::RetirementPeriod::get()),
|
||||
Error::<T>::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<u64>;
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
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<Test>;
|
||||
type ApproveOrigin = system::EnsureRoot<u64>;
|
||||
type RejectOrigin = system::EnsureRoot<u64>;
|
||||
impl pallet_treasury::Trait for Test {
|
||||
type Currency = pallet_balances::Module<Test>;
|
||||
type ApproveOrigin = frame_system::EnsureRoot<u64>;
|
||||
type RejectOrigin = frame_system::EnsureRoot<u64>;
|
||||
type Event = ();
|
||||
type ProposalRejection = ();
|
||||
type ProposalBond = ProposalBond;
|
||||
@@ -756,20 +756,20 @@ mod tests {
|
||||
type ModuleId = CrowdfundModuleId;
|
||||
}
|
||||
|
||||
type System = system::Module<Test>;
|
||||
type Balances = balances::Module<Test>;
|
||||
type System = frame_system::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
type Slots = slots::Module<Test>;
|
||||
type Treasury = treasury::Module<Test>;
|
||||
type Treasury = pallet_treasury::Module<Test>;
|
||||
type Crowdfund = Module<Test>;
|
||||
type RandomnessCollectiveFlip = randomness_collective_flip::Module<Test>;
|
||||
use balances::Error as BalancesError;
|
||||
type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module<Test>;
|
||||
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::<Test>().unwrap();
|
||||
balances::GenesisConfig::<Test>{
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
pallet_balances::GenesisConfig::<Test>{
|
||||
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,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into()
|
||||
));
|
||||
@@ -931,7 +931,7 @@ mod tests {
|
||||
assert_eq!(
|
||||
fund.deploy_data,
|
||||
Some(DeployData {
|
||||
code_hash: <Test as system::Trait>::Hash::default(),
|
||||
code_hash: <Test as frame_system::Trait>::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,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into()),
|
||||
Error::<Test>::InvalidOrigin
|
||||
@@ -960,7 +960,7 @@ mod tests {
|
||||
assert_noop!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
1,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into()),
|
||||
Error::<Test>::InvalidFundIndex
|
||||
@@ -970,7 +970,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -978,7 +978,7 @@ mod tests {
|
||||
assert_noop!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![1].into()),
|
||||
Error::<Test>::ExistingDeployData
|
||||
@@ -998,7 +998,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -1044,7 +1044,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -1072,7 +1072,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -1115,7 +1115,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -1257,7 +1257,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -1286,7 +1286,7 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
@@ -1325,14 +1325,14 @@ mod tests {
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(1),
|
||||
0,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
assert_ok!(Crowdfund::fix_deploy_data(
|
||||
Origin::signed(2),
|
||||
1,
|
||||
<Test as system::Trait>::Hash::default(),
|
||||
<Test as frame_system::Trait>::Hash::default(),
|
||||
0,
|
||||
vec![0].into(),
|
||||
));
|
||||
|
||||
@@ -25,20 +25,20 @@ pub struct ToAuthor<R>(sp_std::marker::PhantomData<R>);
|
||||
|
||||
impl<R> OnUnbalanced<NegativeImbalance<R>> for ToAuthor<R>
|
||||
where
|
||||
R: balances::Trait + authorship::Trait,
|
||||
<R as system::Trait>::AccountId: From<primitives::v0::AccountId>,
|
||||
<R as system::Trait>::AccountId: Into<primitives::v0::AccountId>,
|
||||
<R as system::Trait>::Event: From<balances::RawEvent<
|
||||
<R as system::Trait>::AccountId,
|
||||
<R as balances::Trait>::Balance,
|
||||
balances::DefaultInstance>
|
||||
R: pallet_balances::Trait + pallet_authorship::Trait,
|
||||
<R as frame_system::Trait>::AccountId: From<primitives::v0::AccountId>,
|
||||
<R as frame_system::Trait>::AccountId: Into<primitives::v0::AccountId>,
|
||||
<R as frame_system::Trait>::Event: From<pallet_balances::RawEvent<
|
||||
<R as frame_system::Trait>::AccountId,
|
||||
<R as pallet_balances::Trait>::Balance,
|
||||
pallet_balances::DefaultInstance>
|
||||
>,
|
||||
{
|
||||
fn on_nonzero_unbalanced(amount: NegativeImbalance<R>) {
|
||||
let numeric_amount = amount.peek();
|
||||
let author = <authorship::Module<R>>::author();
|
||||
<balances::Module<R>>::resolve_creating(&<authorship::Module<R>>::author(), amount);
|
||||
<system::Module<R>>::deposit_event(balances::RawEvent::Deposit(author, numeric_amount));
|
||||
let author = <pallet_authorship::Module<R>>::author();
|
||||
<pallet_balances::Module<R>>::resolve_creating(&<pallet_authorship::Module<R>>::author(), amount);
|
||||
<frame_system::Module<R>>::deposit_event(pallet_balances::RawEvent::Deposit(author, numeric_amount));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,18 +47,18 @@ pub struct CurrencyToVoteHandler<R>(sp_std::marker::PhantomData<R>);
|
||||
|
||||
impl<R> CurrencyToVoteHandler<R>
|
||||
where
|
||||
R: balances::Trait,
|
||||
R: pallet_balances::Trait,
|
||||
R::Balance: Into<u128>,
|
||||
{
|
||||
fn factor() -> u128 {
|
||||
let issuance: u128 = <balances::Module<R>>::total_issuance().into();
|
||||
let issuance: u128 = <pallet_balances::Module<R>>::total_issuance().into();
|
||||
(issuance / u64::max_value() as u128).max(1)
|
||||
}
|
||||
}
|
||||
|
||||
impl<R> Convert<u128, u64> for CurrencyToVoteHandler<R>
|
||||
where
|
||||
R: balances::Trait,
|
||||
R: pallet_balances::Trait,
|
||||
R::Balance: Into<u128>,
|
||||
{
|
||||
fn convert(x: u128) -> u64 { (x / Self::factor()) as u64 }
|
||||
@@ -66,7 +66,7 @@ where
|
||||
|
||||
impl<R> Convert<u128, u128> for CurrencyToVoteHandler<R>
|
||||
where
|
||||
R: balances::Trait,
|
||||
R: pallet_balances::Trait,
|
||||
R::Balance: Into<u128>,
|
||||
{
|
||||
fn convert(x: u128) -> u128 { x * Self::factor() }
|
||||
|
||||
@@ -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<T> = <balances::Module<T> as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
|
||||
pub type NegativeImbalance<T> = <pallet_balances::Module<T> as Currency<<T as frame_system::Trait>::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<Runtime>;
|
||||
type System = frame_system::Module<Runtime>;
|
||||
|
||||
fn run_with_system_weight<F>(w: Weight, assertions: F) where F: Fn() -> () {
|
||||
let mut t: sp_io::TestExternalities =
|
||||
system::GenesisConfig::default().build_storage::<Runtime>().unwrap().into();
|
||||
frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap().into();
|
||||
t.execute_with(|| {
|
||||
System::set_block_limits(w, 0);
|
||||
assertions()
|
||||
|
||||
@@ -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<Proof: Parameter + GetSessionNumber> DoubleVoteReport<Proof> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: session::Trait> Get<Vec<T::ValidatorId>> for ValidatorIdentities<T> {
|
||||
impl<T: pallet_session::Trait> Get<Vec<T::ValidatorId>> for ValidatorIdentities<T> {
|
||||
fn get() -> Vec<T::ValidatorId> {
|
||||
<session::Module<T>>::validators()
|
||||
<pallet_session::Module<T>>::validators()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,13 +249,13 @@ impl GetSessionNumber for sp_session::MembershipProof {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Trait: CreateSignedTransaction<Call<Self>> + attestations::Trait + session::historical::Trait {
|
||||
pub trait Trait: CreateSignedTransaction<Call<Self>> + attestations::Trait + pallet_session::historical::Trait {
|
||||
// The transaction signing authority
|
||||
type AuthorityId: system::offchain::AppCrypto<Self::Public, Self::Signature>;
|
||||
type AuthorityId: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>;
|
||||
|
||||
/// The outer origin type.
|
||||
type Origin: From<Origin>
|
||||
+ From<<Self as system::Trait>::Origin>
|
||||
+ From<<Self as frame_system::Trait>::Origin>
|
||||
+ Into<result::Result<Origin, <Self as Trait>::Origin>>;
|
||||
|
||||
/// The outer call dispatch type.
|
||||
@@ -572,7 +572,7 @@ decl_error! {
|
||||
|
||||
decl_module! {
|
||||
/// Parachains module.
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
fn on_initialize(now: T::BlockNumber) -> Weight {
|
||||
@@ -683,7 +683,7 @@ decl_module! {
|
||||
) -> DispatchResult {
|
||||
let reporter = ensure_signed(origin)?;
|
||||
|
||||
let validators = <session::Module<T>>::validators();
|
||||
let validators = <pallet_session::Module<T>>::validators();
|
||||
let validator_set_count = validators.len() as u32;
|
||||
|
||||
let session_index = report.proof.session();
|
||||
@@ -845,7 +845,7 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
|
||||
if let Some(code) = code {
|
||||
Self::note_past_code(id, <system::Module<T>>::block_number(), code);
|
||||
Self::note_past_code(id, <frame_system::Module<T>>::block_number(), code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -916,8 +916,8 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
/// Get a `SigningContext` with a current `SessionIndex` and parent hash.
|
||||
pub fn signing_context() -> SigningContext {
|
||||
let session_index = <session::Module<T>>::current_index();
|
||||
let parent_hash = <system::Module<T>>::parent_hash();
|
||||
let session_index = <pallet_session::Module<T>>::current_index();
|
||||
let parent_hash = <frame_system::Module<T>>::parent_hash();
|
||||
|
||||
SigningContext {
|
||||
session_index,
|
||||
@@ -948,11 +948,11 @@ impl<T: Trait> Module<T> {
|
||||
if let Ok(message_call) = <T as Trait>::Call::decode(&mut &data[..]) {
|
||||
let origin: <T as Trait>::Origin = match origin {
|
||||
ParachainDispatchOrigin::Signed =>
|
||||
<T as Trait>::Origin::from(<T as system::Trait>::Origin::from(system::RawOrigin::Signed(id.into_account()))),
|
||||
<T as Trait>::Origin::from(<T as frame_system::Trait>::Origin::from(frame_system::RawOrigin::Signed(id.into_account()))),
|
||||
ParachainDispatchOrigin::Parachain =>
|
||||
Origin::Parachain(id).into(),
|
||||
ParachainDispatchOrigin::Root =>
|
||||
<T as Trait>::Origin::from(<T as system::Trait>::Origin::from(system::RawOrigin::Root)),
|
||||
<T as Trait>::Origin::from(<T as frame_system::Trait>::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<T: Trait> Module<T> {
|
||||
|
||||
/// Get the global validation schedule for all parachains.
|
||||
pub fn global_validation_data() -> GlobalValidationData {
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
GlobalValidationData {
|
||||
max_code_size: T::MaxCodeSize::get(),
|
||||
max_head_data_size: T::MaxHeadDataSize::get(),
|
||||
@@ -1185,7 +1185,7 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
/// Get the local validation schedule for a particular parachain.
|
||||
pub fn local_validation_data(id: &ParaId, perceived_height: T::BlockNumber) -> Option<LocalValidationData> {
|
||||
if perceived_height + One::one() != <system::Module<T>>::block_number() {
|
||||
if perceived_height + One::one() != <frame_system::Module<T>>::block_number() {
|
||||
// sanity-check - no non-direct-parent blocks allowed at the moment.
|
||||
return None
|
||||
}
|
||||
@@ -1232,7 +1232,7 @@ impl<T: Trait> Module<T> {
|
||||
/// 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<LocalValidationData> {
|
||||
let now: T::BlockNumber = <system::Module<T>>::block_number();
|
||||
let now: T::BlockNumber = <frame_system::Module<T>>::block_number();
|
||||
if now >= One::one() {
|
||||
Self::local_validation_data(id, now - One::one())
|
||||
} else {
|
||||
@@ -1353,8 +1353,8 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
let sorted_validators = make_sorted_duties(&duty_roster.validator_duty);
|
||||
|
||||
let relay_height_now = <system::Module<T>>::block_number();
|
||||
let parent_hash = <system::Module<T>>::parent_hash();
|
||||
let relay_height_now = <frame_system::Module<T>>::block_number();
|
||||
let parent_hash = <frame_system::Module<T>>::parent_hash();
|
||||
let signing_context = Self::signing_context();
|
||||
let code_upgrade_delay = T::ValidationUpgradeDelay::get();
|
||||
|
||||
@@ -1380,7 +1380,7 @@ impl<T: Trait> Module<T> {
|
||||
);
|
||||
|
||||
// Since we only allow execution in context of parent hash.
|
||||
let perceived_relay_block_height = <system::Module<T>>::block_number() - One::one();
|
||||
let perceived_relay_block_height = <frame_system::Module<T>>::block_number() - One::one();
|
||||
|
||||
ensure!(
|
||||
candidate.validity_votes.len() >= majority_of(validator_group.len()),
|
||||
@@ -1452,7 +1452,7 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
Ok(IncludedBlocks {
|
||||
actual_number: relay_height_now,
|
||||
session: <session::Module<T>>::current_index(),
|
||||
session: <pallet_session::Module<T>>::current_index(),
|
||||
random_seed,
|
||||
active_parachains: active_parachains.iter().map(|x| x.0).collect(),
|
||||
para_blocks: para_block_hashes,
|
||||
@@ -1506,7 +1506,7 @@ impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
|
||||
type Public = ValidatorId;
|
||||
}
|
||||
|
||||
impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
type Key = ValidatorId;
|
||||
|
||||
fn on_genesis_session<'a, I: 'a>(validators: I)
|
||||
@@ -1602,11 +1602,11 @@ pub enum DoubleVoteValidityError {
|
||||
}
|
||||
|
||||
impl<T: Trait + Send + Sync> SignedExtension for ValidateDoubleVoteReports<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
const IDENTIFIER: &'static str = "ValidateDoubleVoteReports";
|
||||
type AccountId = T::AccountId;
|
||||
type Call = <T as system::Trait>::Call;
|
||||
type Call = <T as frame_system::Trait>::Call;
|
||||
type AdditionalSigned = ();
|
||||
type Pre = ();
|
||||
|
||||
@@ -1627,7 +1627,7 @@ impl<T: Trait + Send + Sync> SignedExtension for ValidateDoubleVoteReports<T> wh
|
||||
|
||||
if let Some(local_call) = call.is_sub_type() {
|
||||
if let Call::report_double_vote(report) = local_call {
|
||||
let validators = <session::Module<T>>::validators();
|
||||
let validators = <pallet_session::Module<T>>::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 <NodeCodec<Blake2Hasher> as trie_db::NodeCodec<Blake2Hasher>>::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<u128>;
|
||||
type AccountData = pallet_balances::AccountData<u128>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type SystemWeightInfo = ();
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Test where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test where
|
||||
Call: From<C>,
|
||||
{
|
||||
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<Self>;
|
||||
type ShouldEndSession = session::PeriodicSessions<Period, Offset>;
|
||||
type NextSessionRotation = session::PeriodicSessions<Period, Offset>;
|
||||
type SessionManager = session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionHandler = TestSessionHandler;
|
||||
type Keys = TestSessionKeys;
|
||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl session::historical::Trait for Test {
|
||||
type FullIdentification = staking::Exposure<u64, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Self>;
|
||||
impl pallet_session::historical::Trait for Test {
|
||||
type FullIdentification = pallet_staking::Exposure<u64, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Self>;
|
||||
}
|
||||
|
||||
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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::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<Self::AccountId>;
|
||||
type SlashCancelOrigin = frame_system::EnsureRoot<Self::AccountId>;
|
||||
type SessionInterface = Self;
|
||||
type UnixTime = timestamp::Module<Test>;
|
||||
type UnixTime = pallet_timestamp::Module<Test>;
|
||||
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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<ReporterId, sr25519::Signature> for ReporterAuthorityId {
|
||||
impl frame_system::offchain::AppCrypto<ReporterId, sr25519::Signature> for ReporterAuthorityId {
|
||||
type RuntimeAppPublic = ReporterId;
|
||||
type GenericSignature = sr25519::Signature;
|
||||
type GenericPublic = sr25519::Public;
|
||||
@@ -2027,40 +2027,40 @@ mod tests {
|
||||
|
||||
type Extrinsic = TestXt<Call, ()>;
|
||||
|
||||
impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Test where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Test where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
_public: test_keys::ReporterId,
|
||||
_account: <Test as system::Trait>::AccountId,
|
||||
nonce: <Test as system::Trait>::Index,
|
||||
_account: <Test as frame_system::Trait>::AccountId,
|
||||
nonce: <Test as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <Extrinsic as ExtrinsicT>::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<Test>;
|
||||
type Balances = balances::Module<Test>;
|
||||
type System = system::Module<Test>;
|
||||
type Offences = offences::Module<Test>;
|
||||
type Staking = staking::Module<Test>;
|
||||
type Session = session::Module<Test>;
|
||||
type Timestamp = timestamp::Module<Test>;
|
||||
type RandomnessCollectiveFlip = randomness_collective_flip::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
type System = frame_system::Module<Test>;
|
||||
type Offences = pallet_offences::Module<Test>;
|
||||
type Staking = pallet_staking::Module<Test>;
|
||||
type Session = pallet_session::Module<Test>;
|
||||
type Timestamp = pallet_timestamp::Module<Test>;
|
||||
type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module<Test>;
|
||||
type Registrar = registrar::Module<Test>;
|
||||
type Historical = session::historical::Module<Test>;
|
||||
type Historical = pallet_session::historical::Module<Test>;
|
||||
|
||||
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::<Test>().unwrap();
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
|
||||
let authority_keys = [
|
||||
Sr25519Keyring::Alice,
|
||||
@@ -2105,22 +2105,22 @@ mod tests {
|
||||
_phdata: Default::default(),
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
session::GenesisConfig::<Test> {
|
||||
pallet_session::GenesisConfig::<Test> {
|
||||
keys: session_keys,
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
babe::GenesisConfig {
|
||||
pallet_babe::GenesisConfig {
|
||||
authorities: babe_authorities,
|
||||
}.assimilate_storage::<Test>(&mut t).unwrap();
|
||||
|
||||
balances::GenesisConfig::<Test> {
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
balances,
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
staking::GenesisConfig::<Test> {
|
||||
pallet_staking::GenesisConfig::<Test> {
|
||||
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![],
|
||||
|
||||
@@ -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<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
/// Schedule a para to be initialized at the start of the next session.
|
||||
|
||||
@@ -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<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
/// Balances Pallet
|
||||
type Currency: Currency<Self::AccountId>;
|
||||
/// Vesting Pallet
|
||||
@@ -47,7 +47,7 @@ pub trait Trait: system::Trait {
|
||||
type MaxUnlocked: Get<BalanceOf<Self>>;
|
||||
}
|
||||
|
||||
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
|
||||
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::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<Balance> {
|
||||
|
||||
decl_event!(
|
||||
pub enum Event<T> where
|
||||
AccountId = <T as system::Trait>::AccountId,
|
||||
AccountId = <T as frame_system::Trait>::AccountId,
|
||||
Balance = BalanceOf<T>,
|
||||
BlockNumber = <T as system::Trait>::BlockNumber,
|
||||
BlockNumber = <T as frame_system::Trait>::BlockNumber,
|
||||
{
|
||||
/// A new account was created
|
||||
AccountCreated(AccountId),
|
||||
@@ -159,7 +159,7 @@ decl_storage! {
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
/// 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::<T>::block_number(), Error::<T>::InvalidUnlockBlock);
|
||||
ensure!(unlock_block > frame_system::Module::<T>::block_number(), Error::<T>::InvalidUnlockBlock);
|
||||
// Possibly this is worse than having the caller account be the payment account?
|
||||
UnlockBlock::<T>::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<u64>;
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
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<ValidityOrigin, AccountId>;
|
||||
type ConfigurationOrigin = system::EnsureSignedBy<ConfigurationOrigin, AccountId>;
|
||||
type ValidityOrigin = frame_system::EnsureSignedBy<ValidityOrigin, AccountId>;
|
||||
type ConfigurationOrigin = frame_system::EnsureSignedBy<ConfigurationOrigin, AccountId>;
|
||||
type MaxStatementLength = MaxStatementLength;
|
||||
type UnlockedProportion = UnlockedProportion;
|
||||
type MaxUnlocked = MaxUnlocked;
|
||||
}
|
||||
|
||||
type System = system::Module<Test>;
|
||||
type Balances = balances::Module<Test>;
|
||||
type Vesting = vesting::Module<Test>;
|
||||
type System = frame_system::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
type Vesting = pallet_vesting::Module<Test>;
|
||||
type Purchase = Module<Test>;
|
||||
|
||||
// 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::<Test>().unwrap();
|
||||
let t = frame_system::GenesisConfig::default().build_storage::<Test>().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::<Test>::vest());
|
||||
let vest_call = Call::Vesting(pallet_vesting::Call::<Test>::vest());
|
||||
assert_ok!(vest_call.clone().dispatch(Origin::signed(alice())));
|
||||
assert_ok!(vest_call.clone().dispatch(Origin::signed(bob())));
|
||||
assert_eq!(<Test as Trait>::VestingSchedule::vesting_balance(&alice()), Some(45));
|
||||
|
||||
@@ -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<T: Trait> Registrar<T::AccountId> for Module<T> {
|
||||
}
|
||||
|
||||
type BalanceOf<T> =
|
||||
<<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
|
||||
<<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
|
||||
|
||||
pub trait Trait: parachains::Trait {
|
||||
/// The overarching event type.
|
||||
type Event: From<Event> + Into<<Self as system::Trait>::Event>;
|
||||
type Event: From<Event> + Into<<Self as frame_system::Trait>::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<<Self as system::Trait>::Origin>
|
||||
type Origin: From<<Self as frame_system::Trait>::Origin>
|
||||
+ Into<result::Result<parachains::Origin, <Self as Trait>::Origin>>;
|
||||
|
||||
/// The system's currency for parathread payment.
|
||||
@@ -254,7 +254,7 @@ decl_error! {
|
||||
|
||||
decl_module! {
|
||||
/// Parachains module.
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
fn deposit_event() = default;
|
||||
@@ -561,10 +561,10 @@ impl<T: Trait> ActiveParas for Module<T> {
|
||||
/// Ensure that parathread selections happen prioritized by fees.
|
||||
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
|
||||
pub struct LimitParathreadCommits<T: Trait + Send + Sync>(sp_std::marker::PhantomData<T>) where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>;
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>;
|
||||
|
||||
impl<T: Trait + Send + Sync> LimitParathreadCommits<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
/// Create a new `LimitParathreadCommits` struct.
|
||||
pub fn new() -> Self {
|
||||
@@ -573,7 +573,7 @@ impl<T: Trait + Send + Sync> LimitParathreadCommits<T> where
|
||||
}
|
||||
|
||||
impl<T: Trait + Send + Sync> sp_std::fmt::Debug for LimitParathreadCommits<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
|
||||
write!(f, "LimitParathreadCommits<T>")
|
||||
@@ -590,11 +590,11 @@ pub enum ValidityError {
|
||||
}
|
||||
|
||||
impl<T: Trait + Send + Sync> SignedExtension for LimitParathreadCommits<T> where
|
||||
<T as system::Trait>::Call: IsSubType<Call<T>>
|
||||
<T as frame_system::Trait>::Call: IsSubType<Call<T>>
|
||||
{
|
||||
const IDENTIFIER: &'static str = "LimitParathreadCommits";
|
||||
type AccountId = T::AccountId;
|
||||
type Call = <T as system::Trait>::Call;
|
||||
type Call = <T as frame_system::Trait>::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<u128>;
|
||||
type AccountData = pallet_balances::AccountData<u128>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = Balances;
|
||||
type SystemWeightInfo = ();
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Test where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test where
|
||||
Call: From<C>,
|
||||
{
|
||||
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<Test>;
|
||||
type Currency = pallet_balances::Module<Test>;
|
||||
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<Period, Offset>;
|
||||
type NextSessionRotation = session::PeriodicSessions<Period, Offset>;
|
||||
type SessionHandler = session::TestSessionHandler;
|
||||
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
|
||||
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<Test>;
|
||||
type Currency = pallet_balances::Module<Test>;
|
||||
type Slash = ();
|
||||
type Reward = ();
|
||||
type SessionsPerEra = SessionsPerEra;
|
||||
type BondingDuration = BondingDuration;
|
||||
type SlashDeferDuration = SlashDeferDuration;
|
||||
type SlashCancelOrigin = system::EnsureRoot<Self::AccountId>;
|
||||
type SlashCancelOrigin = frame_system::EnsureRoot<Self::AccountId>;
|
||||
type SessionInterface = Self;
|
||||
type UnixTime = timestamp::Module<Test>;
|
||||
type UnixTime = pallet_timestamp::Module<Test>;
|
||||
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<u64, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Self>;
|
||||
impl pallet_session::historical::Trait for Test {
|
||||
type FullIdentification = pallet_staking::Exposure<u64, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Self>;
|
||||
}
|
||||
|
||||
// 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<ReporterId, Signature> for ReporterAuthorityId {
|
||||
impl frame_system::offchain::AppCrypto<ReporterId, Signature> 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<Test>;
|
||||
type ParachainCurrency = pallet_balances::Module<Test>;
|
||||
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<Test>;
|
||||
type KeyOwnerProofSystem = pallet_session::historical::Module<Test>;
|
||||
type IdentificationTuple = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
Vec<u8>,
|
||||
@@ -922,20 +922,20 @@ mod tests {
|
||||
|
||||
type Extrinsic = TestXt<Call, ()>;
|
||||
|
||||
impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Test where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Test where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
_public: test_keys::ReporterId,
|
||||
_account: <Test as system::Trait>::AccountId,
|
||||
nonce: <Test as system::Trait>::Index,
|
||||
_account: <Test as frame_system::Trait>::AccountId,
|
||||
nonce: <Test as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <Extrinsic as ExtrinsicT>::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<Test>;
|
||||
type Currency = pallet_balances::Module<Test>;
|
||||
type ParathreadDeposit = ParathreadDeposit;
|
||||
type SwapAux = slots::Module<Test>;
|
||||
type QueueSize = QueueSize;
|
||||
type MaxRetries = MaxRetries;
|
||||
}
|
||||
|
||||
type Balances = balances::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
type Parachains = parachains::Module<Test>;
|
||||
type System = system::Module<Test>;
|
||||
type System = frame_system::Module<Test>;
|
||||
type Slots = slots::Module<Test>;
|
||||
type Registrar = Module<Test>;
|
||||
type RandomnessCollectiveFlip = randomness_collective_flip::Module<Test>;
|
||||
type Session = session::Module<Test>;
|
||||
type Staking = staking::Module<Test>;
|
||||
type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module<Test>;
|
||||
type Session = pallet_session::Module<Test>;
|
||||
type Staking = pallet_staking::Module<Test>;
|
||||
|
||||
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::<Test>().unwrap();
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
|
||||
let authority_keys = [
|
||||
Sr25519Keyring::Alice,
|
||||
@@ -1008,11 +1008,11 @@ mod tests {
|
||||
_phdata: Default::default(),
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
session::GenesisConfig::<Test> {
|
||||
pallet_session::GenesisConfig::<Test> {
|
||||
keys: session_keys,
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
|
||||
balances::GenesisConfig::<Test> {
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
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::<Test>::current_index(), System::parent_hash()).encode();
|
||||
let payload = (Statement::Valid(candidate_hash), pallet_session::Module::<Test>::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 = <Test as system::Trait>::Hashing::hash(&vec![1, 2, 1]);
|
||||
let good_head_hash = <Test as system::Trait>::Hashing::hash(&vec![1, 1, 1]);
|
||||
let bad_head_hash = <Test as frame_system::Trait>::Hashing::hash(&vec![1, 2, 1]);
|
||||
let good_head_hash = <Test as frame_system::Trait>::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 = <Test as system::Trait>::Hashing::hash(&vec![x; 3]);
|
||||
let head_hash = <Test as frame_system::Trait>::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();
|
||||
|
||||
@@ -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<T> = <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
|
||||
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::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<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
|
||||
/// The currency type used for bidding.
|
||||
type Currency: ReservableCurrency<Self::AccountId>;
|
||||
@@ -118,14 +118,14 @@ pub enum IncomingParachain<AccountId, Hash> {
|
||||
Deploy { code: ValidationCode, initial_head_data: HeadData },
|
||||
}
|
||||
|
||||
type LeasePeriodOf<T> = <T as system::Trait>::BlockNumber;
|
||||
type LeasePeriodOf<T> = <T as frame_system::Trait>::BlockNumber;
|
||||
// Winning data type. This encodes the top bidders of each range together with their bid.
|
||||
type WinningData<T> =
|
||||
[Option<(Bidder<<T as system::Trait>::AccountId>, BalanceOf<T>)>; SLOT_RANGE_COUNT];
|
||||
[Option<(Bidder<<T as frame_system::Trait>::AccountId>, BalanceOf<T>)>; 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<T> =
|
||||
Vec<(Option<NewBidder<<T as system::Trait>::AccountId>>, ParaId, BalanceOf<T>, SlotRange)>;
|
||||
Vec<(Option<NewBidder<<T as frame_system::Trait>::AccountId>>, ParaId, BalanceOf<T>, SlotRange)>;
|
||||
|
||||
// This module's storage items.
|
||||
decl_storage! {
|
||||
@@ -204,8 +204,8 @@ impl<T: Trait> SwapAux for Module<T> {
|
||||
|
||||
decl_event!(
|
||||
pub enum Event<T> where
|
||||
AccountId = <T as system::Trait>::AccountId,
|
||||
BlockNumber = <T as system::Trait>::BlockNumber,
|
||||
AccountId = <T as frame_system::Trait>::AccountId,
|
||||
BlockNumber = <T as frame_system::Trait>::BlockNumber,
|
||||
LeasePeriod = LeasePeriodOf<T>,
|
||||
ParaId = ParaId,
|
||||
Balance = BalanceOf<T>,
|
||||
@@ -262,7 +262,7 @@ decl_error! {
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
fn deposit_event() = default;
|
||||
@@ -322,7 +322,7 @@ decl_module! {
|
||||
let n = <AuctionCounter>::mutate(|n| { *n += 1; *n });
|
||||
|
||||
// Set the information.
|
||||
let ending = <system::Module<T>>::block_number() + duration;
|
||||
let ending = <frame_system::Module<T>>::block_number() + duration;
|
||||
<AuctionInfo<T>>::put((lease_period_index, ending));
|
||||
|
||||
Self::deposit_event(RawEvent::AuctionStarted(n, lease_period_index, ending))
|
||||
@@ -459,7 +459,7 @@ decl_module! {
|
||||
.ok_or(Error::<T>::ParaNotOnboarding)?;
|
||||
if let IncomingParachain::Fixed{code_hash, code_size, initial_head_data} = details {
|
||||
ensure!(code.0.len() as u32 == code_size, Error::<T>::InvalidCode);
|
||||
ensure!(<T as system::Trait>::Hashing::hash(&code.0) == code_hash, Error::<T>::InvalidCode);
|
||||
ensure!(<T as frame_system::Trait>::Hashing::hash(&code.0) == code_hash, Error::<T>::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<T: Trait> Module<T> {
|
||||
|
||||
/// Returns the current lease period.
|
||||
fn lease_period_index() -> LeasePeriodOf<T> {
|
||||
(<system::Module<T>>::block_number() / T::LeasePeriod::get()).into()
|
||||
(<frame_system::Module<T>>::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<T: Trait> Module<T> {
|
||||
// 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(<system::Module<T>>::block_number()).unwrap_or_default();
|
||||
let offset = Self::is_ending(<frame_system::Module<T>>::block_number()).unwrap_or_default();
|
||||
// The current winning ranges.
|
||||
let mut current_winning = <Winning<T>>::get(offset)
|
||||
.or_else(|| offset.checked_sub(&One::one()).and_then(<Winning<T>>::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<u64>;
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
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<Test>;
|
||||
type Balances = balances::Module<Test>;
|
||||
type System = frame_system::Module<Test>;
|
||||
type Balances = pallet_balances::Module<Test>;
|
||||
type Slots = Module<Test>;
|
||||
type RandomnessCollectiveFlip = randomness_collective_flip::Module<Test>;
|
||||
type RandomnessCollectiveFlip = pallet_randomness_collective_flip::Module<Test>;
|
||||
|
||||
// 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::<Test>().unwrap();
|
||||
balances::GenesisConfig::<Test>{
|
||||
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
|
||||
pallet_balances::GenesisConfig::<Test>{
|
||||
balances: vec![(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)],
|
||||
}.assimilate_storage(&mut t).unwrap();
|
||||
t.into()
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
+158
-158
@@ -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<Call> for BaseFilter {
|
||||
type MoreThanHalfCouncil = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
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<Balance>;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::IdentificationTuple;
|
||||
|
||||
type HandleEquivocation =
|
||||
babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Runtime>, // 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<Self, Babe>;
|
||||
impl pallet_authorship::Trait for Runtime {
|
||||
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
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<Self>;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
type ShouldEndSession = Babe;
|
||||
type NextSessionRotation = Babe;
|
||||
type SessionManager = session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||
type Keys = SessionKeys;
|
||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl session::historical::Trait for Runtime {
|
||||
type FullIdentification = staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Runtime>;
|
||||
impl pallet_session::historical::Trait for Runtime {
|
||||
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
|
||||
}
|
||||
|
||||
// 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<AccountId>,
|
||||
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<Self>;
|
||||
@@ -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<AccountId, TechnicalCollective>;
|
||||
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
|
||||
type CooloffPeriod = CooloffPeriod;
|
||||
type PreimageByteDeposit = PreimageByteDeposit;
|
||||
type Slash = Treasury;
|
||||
type Scheduler = Scheduler;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type MaxVotes = MaxVotes;
|
||||
type OperationalPreimageOrigin = collective::EnsureMember<AccountId, CouncilCollective>;
|
||||
type OperationalPreimageOrigin = pallet_collective::EnsureMember<AccountId, CouncilCollective>;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
@@ -412,8 +412,8 @@ parameter_types! {
|
||||
pub const CouncilMaxProposals: u32 = 100;
|
||||
}
|
||||
|
||||
type CouncilCollective = collective::Instance1;
|
||||
impl collective::Trait<CouncilCollective> for Runtime {
|
||||
type CouncilCollective = pallet_collective::Instance1;
|
||||
impl pallet_collective::Trait<CouncilCollective> 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<TechnicalCollective> for Runtime {
|
||||
type TechnicalCollective = pallet_collective::Instance2;
|
||||
impl pallet_collective::Trait<TechnicalCollective> for Runtime {
|
||||
type Origin = Origin;
|
||||
type Proposal = Call;
|
||||
type Event = Event;
|
||||
@@ -467,7 +467,7 @@ impl collective::Trait<TechnicalCollective> for Runtime {
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl membership::Trait<membership::Instance1> for Runtime {
|
||||
impl pallet_membership::Trait<pallet_membership::Instance1> for Runtime {
|
||||
type Event = Event;
|
||||
type AddOrigin = MoreThanHalfCouncil;
|
||||
type RemoveOrigin = MoreThanHalfCouncil;
|
||||
@@ -494,10 +494,10 @@ parameter_types! {
|
||||
type ApproveOrigin = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<Self::KeyOwnerIdentification, Offences>;
|
||||
type HandleEquivocation = pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
type KeyOwnerProofSystem = pallet_session::historical::Module<Self>;
|
||||
type IdentificationTuple = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec<u8>)>>::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<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
public: <Signature as Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: <Runtime as system::Trait>::Index,
|
||||
nonce: <Runtime as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
// take the biggest period possible.
|
||||
let period = BlockHashCount::get()
|
||||
@@ -642,13 +642,13 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
system::CheckNonce::<Runtime>::from(nonce),
|
||||
system::CheckWeight::<Runtime>::new(),
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||
frame_system::CheckGenesis::<Runtime>::new(),
|
||||
frame_system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
frame_system::CheckNonce::<Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
registrar::LimitParathreadCommits::<Runtime>::new(),
|
||||
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
|
||||
);
|
||||
@@ -663,12 +663,12 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
}
|
||||
}
|
||||
|
||||
impl system::offchain::SigningTypes for Runtime {
|
||||
impl frame_system::offchain::SigningTypes for Runtime {
|
||||
type Public = <Signature as Verify>::Signer;
|
||||
type Signature = Signature;
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
Call: From<C>,
|
||||
{
|
||||
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<Runtime>;
|
||||
type FounderSetOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
|
||||
type SuspensionJudgementOrigin = pallet_society::EnsureFounder<Runtime>;
|
||||
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<Call> 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<Call> 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<Call> 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<Call> 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::<Runtime>::migrate_v1_to_t2() {
|
||||
<Runtime as system::Trait>::MaximumBlockWeight::get()
|
||||
if pallet_scheduler::Module::<Runtime>::migrate_v1_to_t2() {
|
||||
<Runtime as frame_system::Trait>::MaximumBlockWeight::get()
|
||||
} else {
|
||||
<Runtime as system::Trait>::DbWeight::get().reads(1) + 500_000_000
|
||||
<Runtime as frame_system::Trait>::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<T>},
|
||||
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage},
|
||||
System: frame_system::{Module, Call, Storage, Config, Event<T>},
|
||||
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<T>, Event<T>},
|
||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: transaction_payment::{Module, Storage},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
||||
|
||||
// Consensus support.
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
Authorship: pallet_authorship::{Module, Call, Storage},
|
||||
Staking: pallet_staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: pallet_offences::{Module, Call, Storage, Event},
|
||||
Historical: session_historical::{Module},
|
||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||
FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
|
||||
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<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config},
|
||||
|
||||
// Governance stuff; uncallable initially.
|
||||
Democracy: democracy::{Module, Call, Storage, Config, Event<T>},
|
||||
Council: collective::<Instance1>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
TechnicalCommittee: collective::<Instance2>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
ElectionsPhragmen: elections_phragmen::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
TechnicalMembership: membership::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Treasury: treasury::{Module, Call, Storage, Event<T>},
|
||||
Democracy: pallet_democracy::{Module, Call, Storage, Config, Event<T>},
|
||||
Council: pallet_collective::<Instance1>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
TechnicalCommittee: pallet_collective::<Instance2>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
ElectionsPhragmen: pallet_elections_phragmen::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
TechnicalMembership: pallet_membership::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Treasury: pallet_treasury::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Claims. Usable initially.
|
||||
Claims: claims::{Module, Call, Storage, Event<T>, Config<T>, ValidateUnsigned},
|
||||
@@ -983,28 +983,28 @@ construct_runtime! {
|
||||
Registrar: registrar::{Module, Call, Storage, Event, Config<T>},
|
||||
|
||||
// Utility module.
|
||||
Utility: utility::{Module, Call, Event},
|
||||
Utility: pallet_utility::{Module, Call, Event},
|
||||
|
||||
// Less simple identity module.
|
||||
Identity: identity::{Module, Call, Storage, Event<T>},
|
||||
Identity: pallet_identity::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Society module.
|
||||
Society: society::{Module, Call, Storage, Event<T>},
|
||||
Society: pallet_society::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Social recovery module.
|
||||
Recovery: recovery::{Module, Call, Storage, Event<T>},
|
||||
Recovery: pallet_recovery::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Vesting. Usable initially, but removed once all vesting is finished.
|
||||
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
|
||||
// System scheduler.
|
||||
Scheduler: scheduler::{Module, Call, Storage, Event<T>},
|
||||
Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Proxy module. Late addition.
|
||||
Proxy: proxy::{Module, Call, Storage, Event<T>},
|
||||
Proxy: pallet_proxy::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Multisig module. Late addition.
|
||||
Multisig: multisig::{Module, Call, Storage, Event<T>},
|
||||
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1020,13 +1020,13 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckMortality<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
system::CheckWeight<Runtime>,
|
||||
transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckMortality<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
registrar::LimitParathreadCommits<Runtime>,
|
||||
parachains::ValidateDoubleVoteReports<Runtime>,
|
||||
);
|
||||
@@ -1035,10 +1035,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<
|
||||
pub type Executive = frame_executive::Executive<
|
||||
Runtime,
|
||||
Block,
|
||||
system::ChainContext<Runtime>,
|
||||
frame_system::ChainContext<Runtime>,
|
||||
Runtime,
|
||||
AllModules,
|
||||
CustomOnRuntimeUpgrade
|
||||
@@ -1245,13 +1245,13 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> 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::<Runtime>);
|
||||
add_benchmark!(params, batches, scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, staking, Staking);
|
||||
add_benchmark!(params, batches, system, SystemBench::<Runtime>);
|
||||
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::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_staking, Staking);
|
||||
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
|
||||
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)
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
/// A collection of weight modules used for pallets in the runtime.
|
||||
|
||||
pub mod balances;
|
||||
pub mod pallet_balances;
|
||||
|
||||
+1
-1
@@ -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))
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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<BlockNumber> {
|
||||
pub scheduling_lookahead: u32,
|
||||
}
|
||||
|
||||
pub trait Trait: system::Trait { }
|
||||
pub trait Trait: frame_system::Trait { }
|
||||
|
||||
decl_storage! {
|
||||
trait Store for Module<T: Trait> as Configuration {
|
||||
@@ -78,7 +78,7 @@ decl_error! {
|
||||
|
||||
decl_module! {
|
||||
/// The parachains configuration module.
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
/// Set the validation upgrade frequency.
|
||||
@@ -227,7 +227,7 @@ impl<T: Trait> Module<T> {
|
||||
GlobalValidationData {
|
||||
max_code_size: config.max_code_size,
|
||||
max_head_data_size: config.max_head_data_size,
|
||||
block_number: <system::Module<T>>::block_number() - One::one(),
|
||||
block_number: <frame_system::Module<T>>::block_number() - One::one(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,9 +87,9 @@ impl<H, N> CandidatePendingAvailability<H, N> {
|
||||
}
|
||||
|
||||
pub trait Trait:
|
||||
system::Trait + paras::Trait + configuration::Trait
|
||||
frame_system::Trait + paras::Trait + configuration::Trait
|
||||
{
|
||||
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
@@ -154,7 +154,7 @@ decl_error! {
|
||||
}
|
||||
|
||||
decl_event! {
|
||||
pub enum Event<T> where <T as system::Trait>::Hash {
|
||||
pub enum Event<T> where <T as frame_system::Trait>::Hash {
|
||||
/// A candidate was backed.
|
||||
CandidateBacked(CandidateReceipt<Hash>, HeadData),
|
||||
/// A candidate was included.
|
||||
@@ -167,7 +167,7 @@ decl_event! {
|
||||
decl_module! {
|
||||
/// The parachain-candidate inclusion module.
|
||||
pub struct Module<T: Trait>
|
||||
for enum Call where origin: <T as system::Trait>::Origin, system = system
|
||||
for enum Call where origin: <T as frame_system::Trait>::Origin
|
||||
{
|
||||
type Error = Error<T>;
|
||||
|
||||
@@ -230,7 +230,7 @@ impl<T: Trait> Module<T> {
|
||||
let mut last_index = None;
|
||||
|
||||
let signing_context = SigningContext {
|
||||
parent_hash: <system::Module<T>>::parent_hash(),
|
||||
parent_hash: <frame_system::Module<T>>::parent_hash(),
|
||||
session_index,
|
||||
};
|
||||
|
||||
@@ -266,7 +266,7 @@ impl<T: Trait> Module<T> {
|
||||
}
|
||||
}
|
||||
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::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<T: Trait> Module<T> {
|
||||
}
|
||||
|
||||
let validators = Validators::get();
|
||||
let parent_hash = <system::Module<T>>::parent_hash();
|
||||
let parent_hash = <frame_system::Module<T>>::parent_hash();
|
||||
let config = <configuration::Module<T>>::config();
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let relay_parent_number = now - One::one();
|
||||
|
||||
// do all checks before writing storage.
|
||||
|
||||
@@ -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<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
fn on_initialize() -> Weight {
|
||||
@@ -134,7 +134,7 @@ impl<T: Trait> ProvideInherent for Module<T> {
|
||||
.map(|(signed_bitfields, backed_candidates): (SignedAvailabilityBitfields, Vec<BackedCandidate<T::Hash>>)| {
|
||||
// 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())
|
||||
|
||||
@@ -55,7 +55,7 @@ struct BufferedSessionChange<N> {
|
||||
}
|
||||
|
||||
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<Self::Hash>;
|
||||
@@ -89,7 +89,7 @@ decl_error! {
|
||||
|
||||
decl_module! {
|
||||
/// The initializer module.
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
|
||||
fn on_initialize(now: T::BlockNumber) -> Weight {
|
||||
@@ -190,7 +190,7 @@ impl<T: Trait> Module<T> {
|
||||
};
|
||||
|
||||
<BufferedSessionChanges<T>>::mutate(|v| v.push(BufferedSessionChange {
|
||||
apply_at: <system::Module<T>>::block_number() + One::one(),
|
||||
apply_at: <frame_system::Module<T>>::block_number() + One::one(),
|
||||
validators,
|
||||
queued,
|
||||
session_index,
|
||||
@@ -202,7 +202,7 @@ impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
|
||||
type Public = ValidatorId;
|
||||
}
|
||||
|
||||
impl<T: session::Trait + Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
impl<T: pallet_session::Trait + Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
type Key = ValidatorId;
|
||||
|
||||
fn on_genesis_session<'a, I: 'a>(_validators: I)
|
||||
@@ -214,7 +214,7 @@ impl<T: session::Trait + Trait> session::OneSessionHandler<T::AccountId> for Mod
|
||||
fn on_new_session<'a, I: 'a>(changed: bool, validators: I, queued: I)
|
||||
where I: Iterator<Item=(&'a T::AccountId, Self::Key)>
|
||||
{
|
||||
let session_index = <session::Module<T>>::current_index();
|
||||
let session_index = <pallet_session::Module<T>>::current_index();
|
||||
<Module<T>>::on_new_session(changed, session_index, validators, Some(queued));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<T>,
|
||||
frame_system<T>,
|
||||
inclusion<T>,
|
||||
}
|
||||
}
|
||||
@@ -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<u128>;
|
||||
type AccountData = pallet_balances::AccountData<u128>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type SystemWeightInfo = ();
|
||||
@@ -109,7 +109,7 @@ impl crate::inclusion::Trait for Test {
|
||||
type Event = TestEvent;
|
||||
}
|
||||
|
||||
pub type System = system::Module<Test>;
|
||||
pub type System = frame_system::Module<Test>;
|
||||
|
||||
/// Mocked initializer.
|
||||
pub type Initializer = crate::initializer::Module<Test>;
|
||||
@@ -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<Test>,
|
||||
pub paras: crate::paras::GenesisConfig<Test>,
|
||||
}
|
||||
|
||||
@@ -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<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
/// Called by the initializer to note that a new session has started.
|
||||
pub(crate) fn initializer_on_new_session(_notification: &SessionChangeNotification<T::BlockNumber>) {
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let mut parachains = Self::clean_up_outgoing(now);
|
||||
Self::apply_incoming(&mut parachains);
|
||||
<Self as Store>::Parachains::set(parachains);
|
||||
@@ -477,7 +477,7 @@ impl<T: Trait> Module<T> {
|
||||
CurrentCode::insert(&id, &new_code);
|
||||
|
||||
// `now` is only used for registering pruning as part of `fn note_past_code`
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
|
||||
let weight = Self::note_past_code(
|
||||
id,
|
||||
@@ -509,7 +509,7 @@ impl<T: Trait> Module<T> {
|
||||
at: T::BlockNumber,
|
||||
assume_intermediate: Option<T::BlockNumber>,
|
||||
) -> Option<ValidationCode> {
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let config = <configuration::Module<T>>::config();
|
||||
|
||||
if assume_intermediate.as_ref().map_or(false, |i| &at <= i) {
|
||||
@@ -553,7 +553,7 @@ impl<T: Trait> Module<T> {
|
||||
/// 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<LocalValidationData<T::BlockNumber>> {
|
||||
let relay_parent_number = <system::Module<T>>::block_number() - One::one();
|
||||
let relay_parent_number = <frame_system::Module<T>>::block_number() - One::one();
|
||||
|
||||
let config = <configuration::Module<T>>::config();
|
||||
let freq = config.validation_upgrade_frequency;
|
||||
|
||||
@@ -243,11 +243,11 @@ pub fn candidate_pending_availability<T: initializer::Trait>(para_id: ParaId)
|
||||
pub fn candidate_events<T, F>(extract_event: F) -> Vec<CandidateEvent<T::Hash>>
|
||||
where
|
||||
T: initializer::Trait,
|
||||
F: Fn(<T as system::Trait>::Event) -> Option<inclusion::Event<T>>,
|
||||
F: Fn(<T as frame_system::Trait>::Event) -> Option<inclusion::Event<T>>,
|
||||
{
|
||||
use inclusion::Event as RawEvent;
|
||||
|
||||
<system::Module<T>>::events().into_iter()
|
||||
<frame_system::Module<T>>::events().into_iter()
|
||||
.filter_map(|record| extract_event(record.event))
|
||||
.map(|event| match event {
|
||||
RawEvent::<T>::CandidateBacked(c, h) => CandidateEvent::CandidateBacked(c, h),
|
||||
|
||||
@@ -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<T: Trait> as ParaScheduler {
|
||||
@@ -147,7 +147,7 @@ decl_error! {
|
||||
|
||||
decl_module! {
|
||||
/// The scheduler module.
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as system::Trait>::Origin, system = system {
|
||||
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
|
||||
type Error = Error<T>;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ impl<T: Trait> Module<T> {
|
||||
let n_parachains = <paras::Module<T>>::parachains().len() as u32;
|
||||
let n_cores = n_parachains + config.parathread_cores;
|
||||
|
||||
<SessionStartBlock<T>>::set(<system::Module<T>>::block_number());
|
||||
<SessionStartBlock<T>>::set(<frame_system::Module<T>>::block_number());
|
||||
AvailabilityCores::mutate(|cores| {
|
||||
// clear all occupied cores.
|
||||
for maybe_occupied in cores.iter_mut() {
|
||||
@@ -355,7 +355,7 @@ impl<T: Trait> Module<T> {
|
||||
let parachains = <paras::Module<T>>::parachains();
|
||||
let mut scheduled = Scheduled::get();
|
||||
let mut parathread_queue = ParathreadQueue::get();
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
|
||||
if ValidatorGroups::get().is_empty() { return }
|
||||
|
||||
@@ -548,7 +548,7 @@ impl<T: Trait> Module<T> {
|
||||
/// 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<Box<dyn Fn(CoreIndex, T::BlockNumber) -> bool>> {
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let config = <configuration::Module<T>>::config();
|
||||
|
||||
let session_start = <SessionStartBlock<T>>::get();
|
||||
@@ -596,7 +596,7 @@ impl<T: Trait> Module<T> {
|
||||
/// Returns a helper for determining group rotation.
|
||||
pub(crate) fn group_rotation_info() -> GroupRotationInfo<T::BlockNumber> {
|
||||
let session_start_block = Self::session_start_block();
|
||||
let now = <system::Module<T>>::block_number();
|
||||
let now = <frame_system::Module<T>>::block_number();
|
||||
let group_rotation_frequency = <configuration::Module<T>>::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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<Call> for BaseFilter {
|
||||
type MoreThanHalfCouncil = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
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<Balance>;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::IdentificationTuple;
|
||||
|
||||
type HandleEquivocation =
|
||||
babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Runtime>, // 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<Self, Babe>;
|
||||
impl pallet_authorship::Trait for Runtime {
|
||||
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
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<Self>;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
type ShouldEndSession = Babe;
|
||||
type NextSessionRotation = Babe;
|
||||
type SessionManager = session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||
type Keys = SessionKeys;
|
||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl session::historical::Trait for Runtime {
|
||||
type FullIdentification = staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Runtime>;
|
||||
impl pallet_session::historical::Trait for Runtime {
|
||||
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
|
||||
}
|
||||
|
||||
// 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<AccountId>,
|
||||
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<Self>;
|
||||
@@ -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<AccountId,
|
||||
collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>,
|
||||
system::EnsureRoot<AccountId>,
|
||||
type ExternalOrigin = frame_system::EnsureOneOf<AccountId,
|
||||
pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>,
|
||||
frame_system::EnsureRoot<AccountId>,
|
||||
>;
|
||||
/// A 60% super-majority can have the next scheduled referendum be a straight majority-carries vote.
|
||||
type ExternalMajorityOrigin = system::EnsureOneOf<AccountId,
|
||||
collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>,
|
||||
system::EnsureRoot<AccountId>,
|
||||
type ExternalMajorityOrigin = frame_system::EnsureOneOf<AccountId,
|
||||
pallet_collective::EnsureProportionAtLeast<_3, _5, AccountId, CouncilCollective>,
|
||||
frame_system::EnsureRoot<AccountId>,
|
||||
>;
|
||||
/// A unanimous council can have the next scheduled referendum be a straight default-carries
|
||||
/// (NTB) vote.
|
||||
type ExternalDefaultOrigin = system::EnsureOneOf<AccountId,
|
||||
collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>,
|
||||
system::EnsureRoot<AccountId>,
|
||||
type ExternalDefaultOrigin = frame_system::EnsureOneOf<AccountId,
|
||||
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, CouncilCollective>,
|
||||
frame_system::EnsureRoot<AccountId>,
|
||||
>;
|
||||
/// 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<AccountId,
|
||||
collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>,
|
||||
system::EnsureRoot<AccountId>,
|
||||
type FastTrackOrigin = frame_system::EnsureOneOf<AccountId,
|
||||
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>,
|
||||
frame_system::EnsureRoot<AccountId>,
|
||||
>;
|
||||
type InstantOrigin = system::EnsureOneOf<AccountId,
|
||||
collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
|
||||
system::EnsureRoot<AccountId>,
|
||||
type InstantOrigin = frame_system::EnsureOneOf<AccountId,
|
||||
pallet_collective::EnsureProportionAtLeast<_1, _1, AccountId, TechnicalCollective>,
|
||||
frame_system::EnsureRoot<AccountId>,
|
||||
>;
|
||||
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<AccountId,
|
||||
collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
|
||||
system::EnsureRoot<AccountId>,
|
||||
type CancellationOrigin = frame_system::EnsureOneOf<AccountId,
|
||||
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
|
||||
frame_system::EnsureRoot<AccountId>,
|
||||
>;
|
||||
// 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<AccountId, TechnicalCollective>;
|
||||
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
|
||||
type CooloffPeriod = CooloffPeriod;
|
||||
type PreimageByteDeposit = PreimageByteDeposit;
|
||||
type OperationalPreimageOrigin = collective::EnsureMember<AccountId, CouncilCollective>;
|
||||
type OperationalPreimageOrigin = pallet_collective::EnsureMember<AccountId, CouncilCollective>;
|
||||
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<CouncilCollective> for Runtime {
|
||||
type CouncilCollective = pallet_collective::Instance1;
|
||||
impl pallet_collective::Trait<CouncilCollective> 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<TechnicalCollective> for Runtime {
|
||||
type TechnicalCollective = pallet_collective::Instance2;
|
||||
impl pallet_collective::Trait<TechnicalCollective> for Runtime {
|
||||
type Origin = Origin;
|
||||
type Proposal = Call;
|
||||
type Event = Event;
|
||||
@@ -522,7 +522,7 @@ impl collective::Trait<TechnicalCollective> for Runtime {
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl membership::Trait<membership::Instance1> for Runtime {
|
||||
impl pallet_membership::Trait<pallet_membership::Instance1> for Runtime {
|
||||
type Event = Event;
|
||||
type AddOrigin = MoreThanHalfCouncil;
|
||||
type RemoveOrigin = MoreThanHalfCouncil;
|
||||
@@ -549,10 +549,10 @@ parameter_types! {
|
||||
type ApproveOrigin = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<Self::KeyOwnerIdentification, Offences>;
|
||||
type HandleEquivocation = pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
type KeyOwnerProofSystem = pallet_session::historical::Module<Self>;
|
||||
type IdentificationTuple = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec<u8>)>>::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<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
public: <Signature as Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: <Runtime as system::Trait>::Index,
|
||||
nonce: <Runtime as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
// take the biggest period possible.
|
||||
let period = BlockHashCount::get()
|
||||
@@ -698,13 +698,13 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
system::CheckNonce::<Runtime>::from(nonce),
|
||||
system::CheckWeight::<Runtime>::new(),
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||
frame_system::CheckGenesis::<Runtime>::new(),
|
||||
frame_system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
frame_system::CheckNonce::<Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
registrar::LimitParathreadCommits::<Runtime>::new(),
|
||||
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
|
||||
claims::PrevalidateAttests::<Runtime>::new(),
|
||||
@@ -720,12 +720,12 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
}
|
||||
}
|
||||
|
||||
impl system::offchain::SigningTypes for Runtime {
|
||||
impl frame_system::offchain::SigningTypes for Runtime {
|
||||
type Public = <Signature as Verify>::Signer;
|
||||
type Signature = Signature;
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Runtime where Call: From<C> {
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where Call: From<C> {
|
||||
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<Call> 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<Call> 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<Call> 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<Call> 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::<Runtime>::iter() {
|
||||
@@ -949,7 +949,7 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||
VotingOf::<Runtime>::insert(who, voting);
|
||||
}
|
||||
|
||||
<Runtime as system::Trait>::MaximumBlockWeight::get()
|
||||
<Runtime as frame_system::Trait>::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::<Runtime>().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::<Runtime>().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<T>},
|
||||
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage},
|
||||
Scheduler: scheduler::{Module, Call, Storage, Event<T>},
|
||||
System: frame_system::{Module, Call, Storage, Config, Event<T>},
|
||||
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Storage},
|
||||
Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// 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<T>, Event<T>},
|
||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: transaction_payment::{Module, Storage},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
||||
|
||||
// Consensus support.
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
Authorship: pallet_authorship::{Module, Call, Storage},
|
||||
Staking: pallet_staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: pallet_offences::{Module, Call, Storage, Event},
|
||||
Historical: session_historical::{Module},
|
||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||
FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
|
||||
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<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config},
|
||||
|
||||
// Governance stuff.
|
||||
Democracy: democracy::{Module, Call, Storage, Config, Event<T>},
|
||||
Council: collective::<Instance1>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
TechnicalCommittee: collective::<Instance2>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
ElectionsPhragmen: elections_phragmen::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
TechnicalMembership: membership::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Treasury: treasury::{Module, Call, Storage, Event<T>},
|
||||
Democracy: pallet_democracy::{Module, Call, Storage, Config, Event<T>},
|
||||
Council: pallet_collective::<Instance1>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
TechnicalCommittee: pallet_collective::<Instance2>::{Module, Call, Storage, Origin<T>, Event<T>, Config<T>},
|
||||
ElectionsPhragmen: pallet_elections_phragmen::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
TechnicalMembership: pallet_membership::<Instance1>::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Treasury: pallet_treasury::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// 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<T>, Config<T>, ValidateUnsigned},
|
||||
// Vesting. Usable initially, but removed once all vesting is finished.
|
||||
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
// 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<T>},
|
||||
|
||||
// Identity. Late addition.
|
||||
Identity: identity::{Module, Call, Storage, Event<T>},
|
||||
Identity: pallet_identity::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Proxy module. Late addition.
|
||||
Proxy: proxy::{Module, Call, Storage, Event<T>},
|
||||
Proxy: pallet_proxy::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Multisig dispatch. Late addition.
|
||||
Multisig: multisig::{Module, Call, Storage, Event<T>},
|
||||
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1159,13 +1159,13 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckMortality<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
system::CheckWeight<Runtime>,
|
||||
transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckMortality<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
registrar::LimitParathreadCommits<Runtime>,
|
||||
parachains::ValidateDoubleVoteReports<Runtime>,
|
||||
claims::PrevalidateAttests<Runtime>,
|
||||
@@ -1175,10 +1175,10 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<
|
||||
pub type Executive = frame_executive::Executive<
|
||||
Runtime,
|
||||
Block,
|
||||
system::ChainContext<Runtime>,
|
||||
frame_system::ChainContext<Runtime>,
|
||||
Runtime,
|
||||
AllModules,
|
||||
CustomOnRuntimeUpgrade
|
||||
@@ -1385,13 +1385,13 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> 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::<Runtime>);
|
||||
add_benchmark!(params, batches, scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, staking, Staking);
|
||||
add_benchmark!(params, batches, system, SystemBench::<Runtime>);
|
||||
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::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_staking, Staking);
|
||||
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
|
||||
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)
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
/// A collection of weight modules used for pallets in the runtime.
|
||||
|
||||
pub mod balances;
|
||||
pub mod pallet_balances;
|
||||
|
||||
+1
-1
@@ -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))
|
||||
@@ -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 = <Runtime as system::Trait>::DbWeight;
|
||||
type DbWeight = <Runtime as frame_system::Trait>::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::<Runtime>(elections_phragmen::Renouncing::Member)
|
||||
let weight = PhragmenCall::renounce_candidacy::<Runtime>(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 = <Runtime as treasury::Trait>::Tippers::max_len() as Weight;
|
||||
let max_len: Weight = <Runtime as pallet_treasury::Trait>::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)]
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckMortality<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
system::CheckWeight<Runtime>,
|
||||
transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckMortality<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
);
|
||||
|
||||
#[cfg(not(feature = "disable-runtime-api"))]
|
||||
@@ -305,13 +305,13 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> 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<Address, Call, Signatu
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
pub type Executive = frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
@@ -343,25 +343,25 @@ construct_runtime! {
|
||||
NodeBlock = primitives::v1::Block,
|
||||
UncheckedExtrinsic = UncheckedExtrinsic
|
||||
{
|
||||
System: system::{Module, Call, Storage, Config, Event<T>},
|
||||
System: frame_system::{Module, Call, Storage, Config, Event<T>},
|
||||
|
||||
// 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<T>, Event<T>},
|
||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: transaction_payment::{Module, Storage},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
||||
|
||||
// Consensus support.
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
Authorship: pallet_authorship::{Module, Call, Storage},
|
||||
Staking: pallet_staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: pallet_offences::{Module, Call, Storage, Event},
|
||||
Historical: session_historical::{Module},
|
||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
|
||||
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
|
||||
ImOnline: pallet_im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
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<Balance>;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
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<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
public: <Signature as Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: <Runtime as system::Trait>::Index,
|
||||
nonce: <Runtime as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
// take the biggest period possible.
|
||||
let period = BlockHashCount::get()
|
||||
@@ -460,13 +460,13 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
system::CheckNonce::<Runtime>::from(nonce),
|
||||
system::CheckWeight::<Runtime>::new(),
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||
frame_system::CheckGenesis::<Runtime>::new(),
|
||||
frame_system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
frame_system::CheckNonce::<Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::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<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
}
|
||||
}
|
||||
|
||||
impl system::offchain::SigningTypes for Runtime {
|
||||
impl frame_system::offchain::SigningTypes for Runtime {
|
||||
type Public = <Signature as Verify>::Signer;
|
||||
type Signature = Signature;
|
||||
}
|
||||
|
||||
impl session::historical::Trait for Runtime {
|
||||
type FullIdentification = staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Runtime>;
|
||||
impl pallet_session::historical::Trait for Runtime {
|
||||
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
@@ -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<C> system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
Call: From<C>,
|
||||
{
|
||||
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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<Runtime>;
|
||||
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<Self>;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
type ShouldEndSession = Babe;
|
||||
type NextSessionRotation = Babe;
|
||||
type SessionManager = session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::IdentificationTuple;
|
||||
|
||||
type HandleEquivocation =
|
||||
babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Self::KeyOwnerIdentification, Offences>;
|
||||
type HandleEquivocation = pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -703,8 +703,8 @@ parameter_types! {
|
||||
}
|
||||
|
||||
// TODO: substrate#2986 implement this properly
|
||||
impl authorship::Trait for Runtime {
|
||||
type FindAuthor = session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
impl pallet_authorship::Trait for Runtime {
|
||||
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
type UncleGenerations = UncleGenerations;
|
||||
type FilterUncle = ();
|
||||
type EventHandler = (Staking, ImOnline);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
+116
-116
@@ -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<Balance>;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::IdentificationTuple;
|
||||
|
||||
type HandleEquivocation =
|
||||
babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Runtime>;
|
||||
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<Self, Babe>;
|
||||
impl pallet_authorship::Trait for Runtime {
|
||||
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<Self::KeyOwnerIdentification, Offences>;
|
||||
type HandleEquivocation = pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
type KeyOwnerProofSystem = pallet_session::historical::Module<Self>;
|
||||
type IdentificationTuple = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec<u8>)>>::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<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
public: <Signature as Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: <Runtime as system::Trait>::Index,
|
||||
nonce: <Runtime as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
// take the biggest period possible.
|
||||
let period = BlockHashCount::get()
|
||||
@@ -435,13 +435,13 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
system::CheckNonce::<Runtime>::from(nonce),
|
||||
system::CheckWeight::<Runtime>::new(),
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||
frame_system::CheckGenesis::<Runtime>::new(),
|
||||
frame_system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
frame_system::CheckNonce::<Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
registrar::LimitParathreadCommits::<Runtime>::new(),
|
||||
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
|
||||
);
|
||||
@@ -456,12 +456,12 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
}
|
||||
}
|
||||
|
||||
impl system::offchain::SigningTypes for Runtime {
|
||||
impl frame_system::offchain::SigningTypes for Runtime {
|
||||
type Public = <Signature as Verify>::Signer;
|
||||
type Signature = Signature;
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
Call: From<C>,
|
||||
{
|
||||
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<AccountId>;
|
||||
type ForceOrigin = system::EnsureRoot<AccountId>;
|
||||
type RegistrarOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
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<Call> 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<Call> 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<Call> 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<Call> 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<T>},
|
||||
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage},
|
||||
System: frame_system::{Module, Call, Storage, Config, Event<T>},
|
||||
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<T>, Event<T>},
|
||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: transaction_payment::{Module, Storage},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
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<T>},
|
||||
FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
|
||||
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<T>, ValidateUnsigned, Config<T>},
|
||||
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<T>},
|
||||
|
||||
// Utility module.
|
||||
Utility: utility::{Module, Call, Event},
|
||||
Utility: pallet_utility::{Module, Call, Event},
|
||||
|
||||
// Less simple identity module.
|
||||
Identity: identity::{Module, Call, Storage, Event<T>},
|
||||
Identity: pallet_identity::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Social recovery module.
|
||||
Recovery: recovery::{Module, Call, Storage, Event<T>},
|
||||
Recovery: pallet_recovery::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Vesting. Usable initially, but removed once all vesting is finished.
|
||||
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
|
||||
// System scheduler.
|
||||
Scheduler: scheduler::{Module, Call, Storage, Event<T>},
|
||||
Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Sudo.
|
||||
Sudo: sudo::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Sudo: pallet_sudo::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
|
||||
// Proxy module. Late addition.
|
||||
Proxy: proxy::{Module, Call, Storage, Event<T>},
|
||||
Proxy: pallet_proxy::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Multisig module. Late addition.
|
||||
Multisig: multisig::{Module, Call, Storage, Event<T>},
|
||||
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,13 +729,13 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckMortality<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
system::CheckWeight<Runtime>,
|
||||
transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckMortality<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
registrar::LimitParathreadCommits<Runtime>,
|
||||
parachains::ValidateDoubleVoteReports<Runtime>,
|
||||
);
|
||||
@@ -744,7 +744,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
pub type Executive = frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
@@ -947,13 +947,13 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> 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::<BenchmarkBatch>::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::<Runtime>);
|
||||
add_benchmark!(params, batches, scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, staking, Staking);
|
||||
add_benchmark!(params, batches, system, SystemBench::<Runtime>);
|
||||
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::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_staking, Staking);
|
||||
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
|
||||
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)
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<Balance>;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type SystemWeightInfo = ();
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
Call: From<C>,
|
||||
{
|
||||
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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::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<Self, Babe>;
|
||||
impl pallet_authorship::Trait for Runtime {
|
||||
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
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<Self>;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
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<AccountId, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Runtime>;
|
||||
impl pallet_session::historical::Trait for Runtime {
|
||||
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
@@ -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<Self>;
|
||||
type KeyOwnerProofSystem = pallet_session::historical::Module<Self>;
|
||||
type IdentificationTuple = <
|
||||
Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec<u8>)>
|
||||
>::IdentificationTuple;
|
||||
@@ -400,14 +400,14 @@ impl parachains::Trait for Runtime {
|
||||
type BlockHashConversion = sp_runtime::traits::Identity;
|
||||
}
|
||||
|
||||
impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
public: <Signature as Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: <Runtime as system::Trait>::Index,
|
||||
nonce: <Runtime as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
let period = BlockHashCount::get()
|
||||
.checked_next_power_of_two()
|
||||
@@ -420,13 +420,13 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
RestrictFunctionality,
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
system::CheckNonce::<Runtime>::from(nonce),
|
||||
system::CheckWeight::<Runtime>::new(),
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||
frame_system::CheckGenesis::<Runtime>::new(),
|
||||
frame_system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
frame_system::CheckNonce::<Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
registrar::LimitParathreadCommits::<Runtime>::new(),
|
||||
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
|
||||
);
|
||||
@@ -442,7 +442,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
}
|
||||
}
|
||||
|
||||
impl system::offchain::SigningTypes for Runtime {
|
||||
impl frame_system::offchain::SigningTypes for Runtime {
|
||||
type Public = <Signature as Verify>::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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<AccountId>;
|
||||
type MoveClaimOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
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<T>},
|
||||
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage},
|
||||
System: frame_system::{Module, Call, Storage, Config, Event<T>},
|
||||
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<T>, Event<T>},
|
||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: transaction_payment::{Module, Storage},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
||||
|
||||
// Consensus support.
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
Authorship: pallet_authorship::{Module, Call, Storage},
|
||||
Staking: pallet_staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: pallet_offences::{Module, Call, Storage, Event},
|
||||
Historical: session_historical::{Module},
|
||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
|
||||
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
|
||||
AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config},
|
||||
|
||||
// Claims. Usable initially.
|
||||
Claims: claims::{Module, Call, Storage, Event<T>, Config<T>, ValidateUnsigned},
|
||||
@@ -557,10 +557,10 @@ construct_runtime! {
|
||||
Registrar: registrar::{Module, Call, Storage, Event, Config<T>},
|
||||
|
||||
// Vesting. Usable initially, but removed once all vesting is finished.
|
||||
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
|
||||
// Sudo. Last module.
|
||||
Sudo: sudo::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Sudo: pallet_sudo::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,13 +577,13 @@ pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
RestrictFunctionality,
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckMortality<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
system::CheckWeight<Runtime>,
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckMortality<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>,
|
||||
registrar::LimitParathreadCommits<Runtime>,
|
||||
parachains::ValidateDoubleVoteReports<Runtime>,
|
||||
);
|
||||
@@ -592,7 +592,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
pub type Executive = frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
@@ -779,7 +779,7 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
fn account_nonce(account: AccountId) -> Nonce {
|
||||
System::account_nonce(account)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
+124
-125
@@ -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<Balance>;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
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 = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
babe::AuthorityId,
|
||||
pallet_babe::AuthorityId,
|
||||
)>>::IdentificationTuple;
|
||||
|
||||
type HandleEquivocation =
|
||||
babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Runtime>;
|
||||
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<Self, Babe>;
|
||||
impl pallet_authorship::Trait for Runtime {
|
||||
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
|
||||
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<Self>;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
type ShouldEndSession = Babe;
|
||||
type NextSessionRotation = Babe;
|
||||
type SessionManager = session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||
type Keys = SessionKeys;
|
||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
impl session::historical::Trait for Runtime {
|
||||
type FullIdentification = staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = staking::ExposureOf<Runtime>;
|
||||
impl pallet_session::historical::Trait for Runtime {
|
||||
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
|
||||
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
@@ -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<Self>;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
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<Self::KeyOwnerIdentification, Offences>;
|
||||
type HandleEquivocation = pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
|
||||
}
|
||||
|
||||
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<Self>;
|
||||
type KeyOwnerProofSystem = pallet_session::historical::Module<Self>;
|
||||
type IdentificationTuple = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec<u8>)>>::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<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime where
|
||||
Call: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
public: <Signature as Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: <Runtime as system::Trait>::Index,
|
||||
nonce: <Runtime as frame_system::Trait>::Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as ExtrinsicT>::SignaturePayload)> {
|
||||
// take the biggest period possible.
|
||||
let period = BlockHashCount::get()
|
||||
@@ -466,13 +466,13 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
.saturating_sub(1);
|
||||
let tip = 0;
|
||||
let extra: SignedExtra = (
|
||||
system::CheckSpecVersion::<Runtime>::new(),
|
||||
system::CheckTxVersion::<Runtime>::new(),
|
||||
system::CheckGenesis::<Runtime>::new(),
|
||||
system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
system::CheckNonce::<Runtime>::from(nonce),
|
||||
system::CheckWeight::<Runtime>::new(),
|
||||
transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
frame_system::CheckSpecVersion::<Runtime>::new(),
|
||||
frame_system::CheckTxVersion::<Runtime>::new(),
|
||||
frame_system::CheckGenesis::<Runtime>::new(),
|
||||
frame_system::CheckMortality::<Runtime>::from(generic::Era::mortal(period, current_block)),
|
||||
frame_system::CheckNonce::<Runtime>::from(nonce),
|
||||
frame_system::CheckWeight::<Runtime>::new(),
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
|
||||
registrar::LimitParathreadCommits::<Runtime>::new(),
|
||||
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
|
||||
);
|
||||
@@ -487,12 +487,12 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
}
|
||||
}
|
||||
|
||||
impl system::offchain::SigningTypes for Runtime {
|
||||
impl frame_system::offchain::SigningTypes for Runtime {
|
||||
type Public = <Signature as Verify>::Signer;
|
||||
type Signature = Signature;
|
||||
}
|
||||
|
||||
impl<C> system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
|
||||
Call: From<C>,
|
||||
{
|
||||
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<AccountId>;
|
||||
type ForceOrigin = system::EnsureRoot<AccountId>;
|
||||
type RegistrarOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
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<Call> 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<Call> 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<Call> 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<Call> 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<T>},
|
||||
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage},
|
||||
System: frame_system::{Module, Call, Storage, Config, Event<T>},
|
||||
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<T>, Event<T>},
|
||||
Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: transaction_payment::{Module, Storage},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Indices: pallet_indices::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
TransactionPayment: pallet_transaction_payment::{Module, Storage},
|
||||
|
||||
// Consensus support.
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
Authorship: pallet_authorship::{Module, Call, Storage},
|
||||
Staking: pallet_staking::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
|
||||
Offences: pallet_offences::{Module, Call, Storage, Event},
|
||||
Historical: session_historical::{Module},
|
||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||
FinalityTracker: finality_tracker::{Module, Call, Storage, Inherent},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event, ValidateUnsigned},
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
|
||||
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<T>, ValidateUnsigned, Config<T>},
|
||||
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<T>},
|
||||
|
||||
// Utility module.
|
||||
Utility: utility::{Module, Call, Event},
|
||||
Utility: pallet_utility::{Module, Call, Event},
|
||||
|
||||
// Less simple identity module.
|
||||
Identity: identity::{Module, Call, Storage, Event<T>},
|
||||
Identity: pallet_identity::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Social recovery module.
|
||||
Recovery: recovery::{Module, Call, Storage, Event<T>},
|
||||
Recovery: pallet_recovery::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Vesting. Usable initially, but removed once all vesting is finished.
|
||||
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Vesting: pallet_vesting::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
|
||||
// System scheduler.
|
||||
Scheduler: scheduler::{Module, Call, Storage, Event<T>},
|
||||
Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Sudo.
|
||||
Sudo: sudo::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
Sudo: pallet_sudo::{Module, Call, Storage, Event<T>, Config<T>},
|
||||
|
||||
// Proxy module. Late addition.
|
||||
Proxy: proxy::{Module, Call, Storage, Event<T>},
|
||||
Proxy: pallet_proxy::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Multisig module. Late addition.
|
||||
Multisig: multisig::{Module, Call, Storage, Event<T>},
|
||||
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>},
|
||||
|
||||
// Purchase module. Late addition.
|
||||
Purchase: purchase::{Module, Call, Storage, Event<T>},
|
||||
@@ -809,13 +809,13 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckMortality<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
system::CheckWeight<Runtime>,
|
||||
transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckMortality<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
registrar::LimitParathreadCommits<Runtime>,
|
||||
parachains::ValidateDoubleVoteReports<Runtime>,
|
||||
);
|
||||
@@ -824,7 +824,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Nonce, Call>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
pub type Executive = frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
@@ -1027,13 +1027,13 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> for Runtime {
|
||||
impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce> 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::<Runtime>);
|
||||
add_benchmark!(params, batches, scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, staking, Staking);
|
||||
add_benchmark!(params, batches, system, SystemBench::<Runtime>);
|
||||
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::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_scheduler, Scheduler);
|
||||
add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>);
|
||||
add_benchmark!(params, batches, pallet_staking, Staking);
|
||||
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
/// A collection of weight modules used for pallets in the runtime.
|
||||
|
||||
pub mod balances;
|
||||
pub mod pallet_balances;
|
||||
|
||||
+1
-1
@@ -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))
|
||||
@@ -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" }
|
||||
|
||||
+103
-103
@@ -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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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::<Vec<_>>(),
|
||||
}),
|
||||
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,
|
||||
}),
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ pub trait RuntimeApiCollection:
|
||||
+ grandpa_primitives::GrandpaApi<Block>
|
||||
+ ParachainHost<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
@@ -50,7 +50,7 @@ where
|
||||
+ grandpa_primitives::GrandpaApi<Block>
|
||||
+ ParachainHost<Block>
|
||||
+ sp_block_builder::BlockBuilder<Block>
|
||||
+ system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Nonce>
|
||||
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
|
||||
+ sp_api::Metadata<Block>
|
||||
+ sp_offchain::OffchainWorkerApi<Block>
|
||||
|
||||
@@ -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" }
|
||||
|
||||
Reference in New Issue
Block a user