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
+5 -5
View File
@@ -71,7 +71,7 @@ pub struct Call;
impl Dispatchable for Call {
type Origin = Origin;
type Trait = ();
type Config = ();
type Info = DispatchInfo;
type PostInfo = PostDispatchInfo;
fn dispatch(self, _origin: Self::Origin)
@@ -80,7 +80,7 @@ impl Dispatchable for Call {
}
}
impl Trait for Test {
impl Config for Test {
type BaseCallFilter = ();
type Origin = Origin;
type Call = Call;
@@ -109,16 +109,16 @@ impl Trait for Test {
}
pub type System = Module<Test>;
pub type SysEvent = <Test as Trait>::Event;
pub type SysEvent = <Test as Config>::Event;
pub const CALL: &<Test as Trait>::Call = &Call;
pub const CALL: &<Test as Config>::Call = &Call;
/// Create new externalities for `System` module tests.
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut ext: sp_io::TestExternalities = GenesisConfig::default().build_storage::<Test>().unwrap().into();
// Add to each test the initial weight of a block
ext.execute_with(|| System::register_extra_weight_unchecked(
<Test as Trait>::BlockExecutionWeight::get(),
<Test as Config>::BlockExecutionWeight::get(),
DispatchClass::Mandatory
));
ext