pub enum VoteType {
SingleChoice,
MultiChoice {
max_voter_options: u8,
max_winning_options: u8,
},
}
Expand description
Proposal vote type
Variants
SingleChoice
Single choice vote with mutually exclusive choices In the SingeChoice mode there can ever be a single winner If multiple options score the same highest vote then the Proposal is not resolved and considered as Failed Note: Yes/No vote is a single choice (Yes) vote with the deny option (No)
MultiChoice
Fields
max_voter_options: u8
The max number of options a voter can choose By default it equals to the number of available options Note: In the current version the limit is not supported and not enforced yet
max_winning_options: u8
The max number of wining options For executable proposals it limits how many options can be executed for a Proposal By default it equals to the number of available options Note: In the current version the limit is not supported and not enforced yet
Multiple options can be selected with up to max_voter_options per voter and with up to max_winning_options of successful options Ex. voters are given 5 options, can choose up to 3 (max_voter_options) and only 1 (max_winning_options) option can win and be executed
Trait Implementations
Get the name of the type without brackets.
Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
Auto Trait Implementations
impl RefUnwindSafe for VoteType
impl UnwindSafe for VoteType
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more