Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Expose some of the staking miner types over metadata #12245

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions frame/election-provider-multi-phase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,25 @@ pub mod pallet {
type WeightInfo: WeightInfo;
}

// Expose some of the miner configs over the metadata such that they can be re-implemented.
kianenigma marked this conversation as resolved.
Show resolved Hide resolved
#[pallet::extra_constants]
impl<T: Config> Pallet<T> {
#[pallet::constant_name(MinerMaxLength)]
fn max_length() -> u32 {
<T::MinerConfig as MinerConfig>::MaxLength::get()
}

#[pallet::constant_name(MinerMaxWeight)]
fn max_weight() -> Weight {
<T::MinerConfig as MinerConfig>::MaxWeight::get()
}

#[pallet::constant_name(MinerMaxVotesPerVoter)]
fn max_votes_per_voter() -> u32 {
<T::MinerConfig as MinerConfig>::MaxVotesPerVoter::get()
}
}

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_initialize(now: T::BlockNumber) -> Weight {
Expand Down