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
@@ -425,7 +425,7 @@ mod test_iterators {
storage::{generator::StorageDoubleMap, IterableStorageDoubleMap, unhashed},
};
pub trait Trait: 'static {
pub trait Config: 'static {
type Origin;
type BlockNumber;
type PalletInfo: crate::traits::PalletInfo;
@@ -433,14 +433,14 @@ mod test_iterators {
}
crate::decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {}
pub struct Module<T: Config> for enum Call where origin: T::Origin, system=self {}
}
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
struct NoDef(u32);
crate::decl_storage! {
trait Store for Module<T: Trait> as Test {
trait Store for Module<T: Config> as Test {
DoubleMap: double_map hasher(blake2_128_concat) u16, hasher(twox_64_concat) u32 => u64;
}
}
@@ -325,7 +325,7 @@ mod test_iterators {
storage::{generator::StorageMap, IterableStorageMap, unhashed},
};
pub trait Trait: 'static {
pub trait Config: 'static {
type Origin;
type BlockNumber;
type PalletInfo: crate::traits::PalletInfo;
@@ -333,14 +333,14 @@ mod test_iterators {
}
crate::decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {}
pub struct Module<T: Config> for enum Call where origin: T::Origin, system=self {}
}
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
struct NoDef(u32);
crate::decl_storage! {
trait Store for Module<T: Trait> as Test {
trait Store for Module<T: Config> as Test {
Map: map hasher(blake2_128_concat) u16 => u64;
}
}
@@ -42,14 +42,14 @@ mod tests {
struct Runtime;
pub trait Trait: 'static {
pub trait Config: 'static {
type Origin;
type BlockNumber;
type PalletInfo: crate::traits::PalletInfo;
type DbWeight: crate::traits::Get<crate::weights::RuntimeDbWeight>;
}
impl Trait for Runtime {
impl Config for Runtime {
type Origin = u32;
type BlockNumber = u32;
type PalletInfo = ();
@@ -57,11 +57,11 @@ mod tests {
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=self {}
pub struct Module<T: Config> for enum Call where origin: T::Origin, system=self {}
}
crate::decl_storage! {
trait Store for Module<T: Trait> as Runtime {
trait Store for Module<T: Config> as Runtime {
Value get(fn value) config(): (u64, u64);
NumberMap: map hasher(identity) u32 => u64;
DoubleMap: double_map hasher(identity) u32, hasher(identity) u32 => u64;