Companion: Rename pallet trait Trait to Config (#2014)

* rename Trait -> Config

* revert diener changes

* rename HostConfig to ActiveConfig as more meaningful

* fix merge

* "Update Substrate"

* cargo update -p sp-io

Co-authored-by: parity-processbot <>
This commit is contained in:
Guillaume Thiolliere
2020-11-30 16:13:43 +01:00
committed by GitHub
parent 7df537fcdd
commit 2d4aa3a42e
76 changed files with 613 additions and 613 deletions
+8 -8
View File
@@ -45,11 +45,11 @@ use serde::{Serialize, Deserialize};
pub use crate::Origin;
pub trait Trait: frame_system::Trait + configuration::Trait {
pub trait Config: frame_system::Config + configuration::Config {
/// The outer origin type.
type Origin: From<Origin>
+ From<<Self as frame_system::Trait>::Origin>
+ Into<result::Result<Origin, <Self as Trait>::Origin>>;
+ From<<Self as frame_system::Config>::Origin>
+ Into<result::Result<Origin, <Self as Config>::Origin>>;
}
// the two key times necessary to track for every code replacement.
@@ -177,7 +177,7 @@ pub struct ParaGenesisArgs {
}
decl_storage! {
trait Store for Module<T: Trait> as Paras {
trait Store for Module<T: Config> as Paras {
/// All parachains. Ordered ascending by ParaId. Parathreads are not included.
Parachains get(fn parachains): Vec<ParaId>;
/// All parathreads.
@@ -224,7 +224,7 @@ decl_storage! {
}
#[cfg(feature = "std")]
fn build<T: Trait>(config: &GenesisConfig<T>) {
fn build<T: Config>(config: &GenesisConfig<T>) {
let mut parachains: Vec<_> = config.paras
.iter()
.filter(|(_, args)| args.parachain)
@@ -244,17 +244,17 @@ fn build<T: Trait>(config: &GenesisConfig<T>) {
}
decl_error! {
pub enum Error for Module<T: Trait> { }
pub enum Error for Module<T: Config> { }
}
decl_module! {
/// The parachains configuration module.
pub struct Module<T: Trait> for enum Call where origin: <T as frame_system::Trait>::Origin {
pub struct Module<T: Config> for enum Call where origin: <T as frame_system::Config>::Origin {
type Error = Error<T>;
}
}
impl<T: Trait> Module<T> {
impl<T: Config> Module<T> {
/// Called by the initializer to initialize the configuration module.
pub(crate) fn initializer_initialize(now: T::BlockNumber) -> Weight {
Self::prune_old_code(now)