mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 00:01:03 +00:00
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:
committed by
GitHub
parent
dd3c84c362
commit
1cbfc9257f
@@ -139,9 +139,9 @@ pub const VOTER_SET_SIZE: usize = 64;
|
||||
/// NUmber of approvals grouped in one chunk.
|
||||
pub const APPROVAL_SET_SIZE: usize = 8;
|
||||
|
||||
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;
|
||||
|
||||
/// Index used to access chunks.
|
||||
type SetIndex = u32;
|
||||
@@ -152,8 +152,8 @@ type ApprovalFlag = u32;
|
||||
/// Number of approval flags that can fit into [`ApprovalFlag`] type.
|
||||
const APPROVAL_FLAG_LEN: usize = 32;
|
||||
|
||||
pub trait Trait: frame_system::Trait {
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
|
||||
pub trait Config: frame_system::Config {
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
|
||||
|
||||
/// Identifier for the elections pallet's lock
|
||||
type ModuleId: Get<LockIdentifier>;
|
||||
@@ -218,7 +218,7 @@ pub trait Trait: frame_system::Trait {
|
||||
}
|
||||
|
||||
decl_storage! {
|
||||
trait Store for Module<T: Trait> as Elections {
|
||||
trait Store for Module<T: Config> as Elections {
|
||||
// ---- parameters
|
||||
|
||||
/// How long to give each top candidate to present themselves after the vote ends.
|
||||
@@ -286,7 +286,7 @@ decl_storage! {
|
||||
|
||||
decl_error! {
|
||||
/// Error for the elections module.
|
||||
pub enum Error for Module<T: Trait> {
|
||||
pub enum Error for Module<T: Config> {
|
||||
/// Reporter must be a voter.
|
||||
NotVoter,
|
||||
/// Target for inactivity cleanup must be active.
|
||||
@@ -345,7 +345,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>;
|
||||
|
||||
/// How much should be locked up in order to submit one's candidacy. A reasonable
|
||||
@@ -706,7 +706,7 @@ decl_module! {
|
||||
}
|
||||
|
||||
decl_event!(
|
||||
pub enum Event<T> where <T as frame_system::Trait>::AccountId {
|
||||
pub enum Event<T> where <T as frame_system::Config>::AccountId {
|
||||
/// Reaped \[voter, reaper\].
|
||||
VoterReaped(AccountId, AccountId),
|
||||
/// Slashed \[reaper\].
|
||||
@@ -719,7 +719,7 @@ decl_event!(
|
||||
}
|
||||
);
|
||||
|
||||
impl<T: Trait> Module<T> {
|
||||
impl<T: Config> Module<T> {
|
||||
// exposed immutables.
|
||||
|
||||
/// True if we're currently in a presentation period.
|
||||
|
||||
Reference in New Issue
Block a user