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
+4 -4
View File
@@ -197,7 +197,7 @@ impl ExtrinsicT for Extrinsic {
impl sp_runtime::traits::Dispatchable for Extrinsic {
type Origin = Origin;
type Trait = ();
type Config = ();
type Info = ();
type PostInfo = ();
fn dispatch(self, _origin: Self::Origin) -> sp_runtime::DispatchResultWithInfo<Self::PostInfo> {
@@ -436,7 +436,7 @@ parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}
impl frame_system::Trait for Runtime {
impl frame_system::Config for Runtime {
type BaseCallFilter = ();
type Origin = Origin;
type Call = Extrinsic;
@@ -464,7 +464,7 @@ impl frame_system::Trait for Runtime {
type SystemWeightInfo = ();
}
impl pallet_timestamp::Trait for Runtime {
impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = ();
@@ -477,7 +477,7 @@ parameter_types! {
pub const ExpectedBlockTime: u64 = 10_000;
}
impl pallet_babe::Trait for Runtime {
impl pallet_babe::Config for Runtime {
type EpochDuration = EpochDuration;
type ExpectedBlockTime = ExpectedBlockTime;
// there is no actual runtime in this test-runtime, so testing crates
+3 -3
View File
@@ -32,7 +32,7 @@ use sp_runtime::{
},
};
use codec::{KeyedVec, Encode, Decode};
use frame_system::Trait;
use frame_system::Config;
use crate::{
AccountId, BlockNumber, Extrinsic, Transfer, H256 as Hash, Block, Header, Digest, AuthorityId
};
@@ -42,11 +42,11 @@ const NONCE_OF: &[u8] = b"nonce:";
const BALANCE_OF: &[u8] = b"balance:";
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {}
pub struct Module<T: Config> for enum Call where origin: T::Origin {}
}
decl_storage! {
trait Store for Module<T: Trait> as TestRuntime {
trait Store for Module<T: Config> as TestRuntime {
ExtrinsicData: map hasher(blake2_128_concat) u32 => Vec<u8>;
// The current block number being processed. Set by `execute_block`.
Number get(fn number): Option<BlockNumber>;