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
+9 -9
View File
@@ -29,16 +29,16 @@ use frame_support::{
use frame_system::{RawOrigin, ensure_signed, ensure_none};
decl_storage! {
trait Store for Module<T: Trait> as Test where
<T as OtherTrait>::OtherEvent: Into<<T as Trait>::Event>
trait Store for Module<T: Config> as Test where
<T as OtherTrait>::OtherEvent: Into<<T as Config>::Event>
{
Value get(fn value): Option<u32>;
}
}
decl_module! {
pub struct Module<T: Trait> for enum Call where
origin: T::Origin, <T as OtherTrait>::OtherEvent: Into<<T as Trait>::Event>
pub struct Module<T: Config> for enum Call where
origin: T::Origin, <T as OtherTrait>::OtherEvent: Into<<T as Config>::Event>
{
#[weight = 0]
fn set_value(origin, n: u32) -> DispatchResult {
@@ -63,8 +63,8 @@ pub trait OtherTrait {
type OtherEvent;
}
pub trait Trait: frame_system::Trait + OtherTrait
where Self::OtherEvent: Into<<Self as Trait>::Event>
pub trait Config: frame_system::Config + OtherTrait
where Self::OtherEvent: Into<<Self as Config>::Event>
{
type Event;
}
@@ -72,7 +72,7 @@ pub trait Trait: frame_system::Trait + OtherTrait
#[derive(Clone, Eq, PartialEq)]
pub struct Test;
impl frame_system::Trait for Test {
impl frame_system::Config for Test {
type BaseCallFilter = ();
type Origin = Origin;
type Index = u64;
@@ -100,7 +100,7 @@ impl frame_system::Trait for Test {
type SystemWeightInfo = ();
}
impl Trait for Test {
impl Config for Test {
type Event = ();
}
@@ -113,7 +113,7 @@ fn new_test_ext() -> sp_io::TestExternalities {
}
benchmarks!{
where_clause { where <T as OtherTrait>::OtherEvent: Into<<T as Trait>::Event> }
where_clause { where <T as OtherTrait>::OtherEvent: Into<<T as Config>::Event> }
_ {
// Define a common range for `b`.