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:
Shawn Tabrizi
2020-08-04 15:23:33 +02:00
committed by GitHub
parent c01aa8bae8
commit 73f09e5154
54 changed files with 1680 additions and 1690 deletions
@@ -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:
+72 -72
View File
@@ -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)
}