Rename pallet trait Trait to Config (#7599)

* rename Trait to Config

* add test asserting using Trait is still valid.

* fix ui tests
This commit is contained in:
Guillaume Thiolliere
2020-11-30 15:34:54 +01:00
committed by GitHub
parent dd3c84c362
commit 1cbfc9257f
200 changed files with 1767 additions and 1607 deletions
+10 -10
View File
@@ -19,7 +19,7 @@
#![cfg(test)]
use crate::{AuthorityId, AuthorityList, ConsensusLog, Module, Trait};
use crate::{AuthorityId, AuthorityList, ConsensusLog, Module, Config};
use ::grandpa as finality_grandpa;
use codec::Encode;
use frame_support::{
@@ -79,7 +79,7 @@ parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
impl frame_system::Trait for Test {
impl frame_system::Config for Test {
type BaseCallFilter = ();
type Origin = Origin;
type Index = u64;
@@ -122,7 +122,7 @@ parameter_types! {
}
/// Custom `SessionHandler` since we use `TestSessionKeys` as `Keys`.
impl pallet_session::Trait for Test {
impl pallet_session::Config for Test {
type Event = TestEvent;
type ValidatorId = u64;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
@@ -135,7 +135,7 @@ impl pallet_session::Trait for Test {
type WeightInfo = ();
}
impl pallet_session::historical::Trait for Test {
impl pallet_session::historical::Config for Test {
type FullIdentification = pallet_staking::Exposure<u64, u128>;
type FullIdentificationOf = pallet_staking::ExposureOf<Self>;
}
@@ -144,7 +144,7 @@ parameter_types! {
pub const UncleGenerations: u64 = 0;
}
impl pallet_authorship::Trait for Test {
impl pallet_authorship::Config for Test {
type FindAuthor = ();
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
@@ -155,7 +155,7 @@ parameter_types! {
pub const ExistentialDeposit: u128 = 1;
}
impl pallet_balances::Trait for Test {
impl pallet_balances::Config for Test {
type MaxLocks = ();
type Balance = u128;
type DustRemoval = ();
@@ -169,7 +169,7 @@ parameter_types! {
pub const MinimumPeriod: u64 = 3;
}
impl pallet_timestamp::Trait for Test {
impl pallet_timestamp::Config for Test {
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = MinimumPeriod;
@@ -198,7 +198,7 @@ parameter_types! {
pub const StakingUnsignedPriority: u64 = u64::max_value() / 2;
}
impl pallet_staking::Trait for Test {
impl pallet_staking::Config for Test {
type RewardRemainder = ();
type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote;
type Event = TestEvent;
@@ -227,14 +227,14 @@ parameter_types! {
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
}
impl pallet_offences::Trait for Test {
impl pallet_offences::Config for Test {
type Event = TestEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
impl Trait for Test {
impl Config for Test {
type Event = TestEvent;
type Call = Call;