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
+12 -12
View File
@@ -17,7 +17,7 @@
//! # Democracy Pallet
//!
//! - [`democracy::Trait`](./trait.Trait.html)
//! - [`democracy::Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//!
//! ## Overview
@@ -199,13 +199,13 @@ pub type PropIndex = u32;
/// A referendum index.
pub type ReferendumIndex = u32;
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
type BalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
type NegativeImbalanceOf<T> =
<<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
pub trait Trait: frame_system::Trait + Sized {
pub trait Config: frame_system::Config + Sized {
type Proposal: Parameter + Dispatchable<Origin=Self::Origin> + From<Call<Self>>;
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
/// Currency type for this module.
type Currency: ReservableCurrency<Self::AccountId>
@@ -338,7 +338,7 @@ enum Releases {
}
decl_storage! {
trait Store for Module<T: Trait> as Democracy {
trait Store for Module<T: Config> as Democracy {
// TODO: Refactor public proposal queue into its own pallet.
// https://github.com/paritytech/substrate/issues/5322
/// The number of (public) proposals that have been made so far.
@@ -413,9 +413,9 @@ decl_storage! {
decl_event! {
pub enum Event<T> where
Balance = BalanceOf<T>,
<T as frame_system::Trait>::AccountId,
<T as frame_system::Trait>::Hash,
<T as frame_system::Trait>::BlockNumber,
<T as frame_system::Config>::AccountId,
<T as frame_system::Config>::Hash,
<T as frame_system::Config>::BlockNumber,
{
/// A motion has been proposed by a public account. \[proposal_index, deposit\]
Proposed(PropIndex, Balance),
@@ -461,7 +461,7 @@ decl_event! {
}
decl_error! {
pub enum Error for Module<T: Trait> {
pub enum Error for Module<T: Config> {
/// Value too low
ValueLow,
/// Proposal does not exist
@@ -537,7 +537,7 @@ decl_error! {
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
pub struct Module<T: Config> for enum Call where origin: T::Origin {
type Error = Error<T>;
/// The minimum period of locking and the period between a proposal being approved and enacted.
@@ -1168,7 +1168,7 @@ decl_module! {
}
}
impl<T: Trait> Module<T> {
impl<T: Config> Module<T> {
// exposed immutables.
/// Get the amount locked in support of `proposal`; `None` if proposal isn't a valid proposal