pub enum VoteType {
SingleChoice,
MultiChoice {
choice_type: MultiChoiceType,
min_voter_options: u8,
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
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
Fields
§
choice_type: MultiChoiceTypeType of MultiChoice
§
min_voter_options: u8The min number of options a voter must choose
Note: In the current version the limit is not supported and not enforced and must always be set to 1
Trait Implementations§
Source§impl BorshDeserialize for VoteType
impl BorshDeserialize for VoteType
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSchema for VoteType
impl BorshSchema for VoteType
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn 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.
Source§fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition>,
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition>, )
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
Source§impl BorshSerialize for VoteType
impl BorshSerialize for VoteType
impl Eq for VoteType
impl StructuralPartialEq for VoteType
Auto Trait Implementations§
impl Freeze for VoteType
impl RefUnwindSafe for VoteType
impl Send for VoteType
impl Sync for VoteType
impl Unpin for VoteType
impl UnwindSafe for VoteType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more