mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Refactor CurrencyToVote (#6896)
* Refactor CurrencyToVote to avoid calls to total_issuance. * Update frame/support/src/traits.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Some grumbles * Fix last grumbles. * Fix comment * Final fix Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -30,7 +30,10 @@ use frame_support::{
|
||||
Weight, IdentityFee,
|
||||
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
|
||||
},
|
||||
traits::{Currency, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier},
|
||||
traits::{
|
||||
Currency, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier,
|
||||
U128CurrencyToVote,
|
||||
},
|
||||
};
|
||||
use frame_system::{EnsureRoot, EnsureOneOf};
|
||||
use frame_support::traits::InstanceFilter;
|
||||
@@ -78,7 +81,7 @@ pub use pallet_staking::StakerStatus;
|
||||
|
||||
/// Implementations of some helper traits passed into runtime modules as associated types.
|
||||
pub mod impls;
|
||||
use impls::{CurrencyToVoteHandler, Author};
|
||||
use impls::Author;
|
||||
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
@@ -448,7 +451,7 @@ parameter_types! {
|
||||
impl pallet_staking::Trait for Runtime {
|
||||
type Currency = Balances;
|
||||
type UnixTime = Timestamp;
|
||||
type CurrencyToVote = CurrencyToVoteHandler;
|
||||
type CurrencyToVote = U128CurrencyToVote;
|
||||
type RewardRemainder = Treasury;
|
||||
type Event = Event;
|
||||
type Slash = Treasury; // send the slashed funds to the treasury.
|
||||
@@ -574,7 +577,7 @@ impl pallet_elections_phragmen::Trait for Runtime {
|
||||
// NOTE: this implies that council's genesis members cannot be set directly and must come from
|
||||
// this module.
|
||||
type InitializeMembers = Council;
|
||||
type CurrencyToVote = CurrencyToVoteHandler;
|
||||
type CurrencyToVote = U128CurrencyToVote;
|
||||
type CandidacyBond = CandidacyBond;
|
||||
type VotingBond = VotingBond;
|
||||
type LoserCandidate = ();
|
||||
|
||||
Reference in New Issue
Block a user