mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 23:21:02 +00:00
* `ModuleId` to `PalletId` - part of #8372 * fix doc * move `PalletId` to `frame-support` * fix compile * fix tests * `ModuleId` to `PalletId` * subcommand `moduleid` to `palletid`
This commit is contained in:
@@ -175,7 +175,7 @@ pub trait Config: frame_system::Config {
|
||||
type Event: From<Event<Self>> + Into<<Self as frame_system::Config>::Event>;
|
||||
|
||||
/// Identifier for the elections-phragmen pallet's lock
|
||||
type ModuleId: Get<LockIdentifier>;
|
||||
type PalletId: Get<LockIdentifier>;
|
||||
|
||||
/// The currency that people are electing with.
|
||||
type Currency:
|
||||
@@ -375,7 +375,7 @@ decl_module! {
|
||||
const DesiredMembers: u32 = T::DesiredMembers::get();
|
||||
const DesiredRunnersUp: u32 = T::DesiredRunnersUp::get();
|
||||
const TermDuration: T::BlockNumber = T::TermDuration::get();
|
||||
const ModuleId: LockIdentifier = T::ModuleId::get();
|
||||
const PalletId: LockIdentifier = T::PalletId::get();
|
||||
|
||||
/// Vote for a set of candidates for the upcoming round of election. This can be called to
|
||||
/// set the initial votes, or update already existing votes.
|
||||
@@ -452,7 +452,7 @@ decl_module! {
|
||||
// Amount to be locked up.
|
||||
let locked_stake = value.min(T::Currency::total_balance(&who));
|
||||
T::Currency::set_lock(
|
||||
T::ModuleId::get(),
|
||||
T::PalletId::get(),
|
||||
&who,
|
||||
locked_stake,
|
||||
WithdrawReasons::all(),
|
||||
@@ -807,7 +807,7 @@ impl<T: Config> Module<T> {
|
||||
let Voter { deposit, .. } = <Voting<T>>::take(who);
|
||||
|
||||
// remove storage, lock and unreserve.
|
||||
T::Currency::remove_lock(T::ModuleId::get(), who);
|
||||
T::Currency::remove_lock(T::PalletId::get(), who);
|
||||
|
||||
// NOTE: we could check the deposit amount before removing and skip if zero, but it will be
|
||||
// a noop anyhow.
|
||||
@@ -1158,11 +1158,11 @@ mod tests {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect";
|
||||
pub const ElectionsPhragmenPalletId: LockIdentifier = *b"phrelect";
|
||||
}
|
||||
|
||||
impl Config for Test {
|
||||
type ModuleId = ElectionsPhragmenModuleId;
|
||||
type PalletId = ElectionsPhragmenPalletId;
|
||||
type Event = Event;
|
||||
type Currency = Balances;
|
||||
type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote;
|
||||
@@ -1313,7 +1313,7 @@ mod tests {
|
||||
.get(0)
|
||||
.cloned()
|
||||
.map(|lock| {
|
||||
assert_eq!(lock.id, ElectionsPhragmenModuleId::get());
|
||||
assert_eq!(lock.id, ElectionsPhragmenPalletId::get());
|
||||
lock.amount
|
||||
})
|
||||
.unwrap_or_default()
|
||||
|
||||
Reference in New Issue
Block a user