mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
Further Improve Gov V2 Stuff (#12028)
* refactor and improve successful origin * use appropriate origin for creating referendum * fmt * add setup tally feature for benchmarks * feedback updates * fmt * Update frame/referenda/src/benchmarking.rs Co-authored-by: Gavin Wood <gavin@parity.io> * feedback on `setup` trait * fix Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
@@ -106,6 +106,19 @@ pub trait VoteTally<Votes, Class> {
|
||||
fn rejection(class: Class) -> Self;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn from_requirements(support: Perbill, approval: Perbill, class: Class) -> Self;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
/// A function that should be called before any use of the `runtime-benchmarks` gated functions
|
||||
/// of the `VoteTally` trait.
|
||||
///
|
||||
/// Should be used to set up any needed state in a Pallet which implements `VoteTally` so that
|
||||
/// benchmarks that execute will complete successfully. `class` can be used to set up a
|
||||
/// particular class of voters, and `granularity` is used to determine the weight of one vote
|
||||
/// relative to total unanimity.
|
||||
///
|
||||
/// For example, in the case where there are a number of unique voters, and each voter has equal
|
||||
/// voting weight, a granularity of `Perbill::from_rational(1, 1000)` should create `1_000`
|
||||
/// users.
|
||||
fn setup(class: Class, granularity: Perbill);
|
||||
}
|
||||
pub enum PollStatus<Tally, Moment, Class> {
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user