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
+11 -11
View File
@@ -27,9 +27,9 @@ mod module {
use super::*;
pub type Request<T> = (
<T as system::Trait>::AccountId,
<T as system::Config>::AccountId,
Role,
<T as system::Trait>::BlockNumber,
<T as system::Config>::BlockNumber,
);
pub type Requests<T> = Vec<Request<T>>;
@@ -39,7 +39,7 @@ mod module {
}
#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Debug)]
pub struct RoleParameters<T: Trait> {
pub struct RoleParameters<T: Config> {
// minimum actors to maintain - if role is unstaking
// and remaining actors would be less that this value - prevent or punish for unstaking
pub min_actors: u32,
@@ -65,7 +65,7 @@ mod module {
pub startup_grace_period: T::BlockNumber,
}
impl<T: Trait> Default for RoleParameters<T> {
impl<T: Config> Default for RoleParameters<T> {
fn default() -> Self {
Self {
max_actors: 10,
@@ -81,18 +81,18 @@ mod module {
}
}
pub trait Trait: system::Trait {}
pub trait Config: system::Config {}
frame_support::decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin, system=system {}
pub struct Module<T: Config> for enum Call where origin: T::Origin, system=system {}
}
#[derive(Encode, Decode, Copy, Clone, Serialize, Deserialize)]
pub struct Data<T: Trait> {
pub struct Data<T: Config> {
pub data: T::BlockNumber,
}
impl<T: Trait> Default for Data<T> {
impl<T: Config> Default for Data<T> {
fn default() -> Self {
Self {
data: T::BlockNumber::default(),
@@ -101,7 +101,7 @@ mod module {
}
frame_support::decl_storage! {
trait Store for Module<T: Trait> as Actors {
trait Store for Module<T: Config> as Actors {
/// requirements to enter and maintain status in roles
pub Parameters get(fn parameters) build(|config: &GenesisConfig| {
if config.enable_storage_role {
@@ -157,7 +157,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
impl system::Trait for Runtime {
impl system::Config for Runtime {
type BaseCallFilter = ();
type Hash = H256;
type Origin = Origin;
@@ -169,7 +169,7 @@ impl system::Trait for Runtime {
type DbWeight = ();
}
impl module::Trait for Runtime {}
impl module::Config for Runtime {}
frame_support::construct_runtime!(
pub enum Runtime where