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
sourceimpl BorshDeserialize for VoteType where
u8: BorshDeserialize,
u8: BorshDeserialize,
impl BorshDeserialize for VoteType where
u8: BorshDeserialize,
u8: BorshDeserialize,
sourceimpl BorshSchema for VoteType
impl BorshSchema for VoteType
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
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
sourcefn 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.
fn schema_container() -> BorshSchemaContainer
sourceimpl BorshSerialize for VoteType where
u8: BorshSerialize,
u8: BorshSerialize,
impl BorshSerialize for VoteType where
u8: BorshSerialize,
u8: BorshSerialize,
impl StructuralPartialEq for VoteType
Auto Trait Implementations
impl RefUnwindSafe for VoteType
impl Send for VoteType
impl Sync for VoteType
impl Unpin for VoteType
impl UnwindSafe for VoteType
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more