pub struct MultipleChoiceProposal {Show 13 fields
pub title: String,
pub description: String,
pub proposer: Addr,
pub start_height: u64,
pub min_voting_period: Option<Expiration>,
pub expiration: Expiration,
pub choices: Vec<CheckedMultipleChoiceOption>,
pub status: Status,
pub voting_strategy: VotingStrategy,
pub total_power: Uint128,
pub votes: MultipleChoiceVotes,
pub allow_revoting: bool,
pub veto: Option<VetoConfig>,
}Fields§
§title: StringThe title of the proposal
description: StringThe main body of the proposal text
proposer: AddrThe address that created this proposal.
start_height: u64The block height at which this proposal was created. Voting power queries should query for voting power at this block height.
min_voting_period: Option<Expiration>The minimum amount of time this proposal must remain open for voting. The proposal may not pass unless this is expired or None.
expiration: ExpirationThe the time at which this proposal will expire and close for additional votes.
choices: Vec<CheckedMultipleChoiceOption>The options to be chosen from in the vote.
status: StatusThe proposal status
voting_strategy: VotingStrategyVoting settings (threshold, quorum, etc.)
total_power: Uint128The total power when the proposal started (used to calculate percentages)
votes: MultipleChoiceVotesThe vote tally.
allow_revoting: boolWhether DAO members are allowed to change their votes. When disabled, proposals can be executed as soon as they pass. When enabled, proposals can only be executed after the voting perid has ended and the proposal passed.
veto: Option<VetoConfig>Optional veto configuration. If set to None, veto option
is disabled. Otherwise contains the configuration for veto flow.
Implementations§
Source§impl MultipleChoiceProposal
impl MultipleChoiceProposal
Sourcepub fn into_response(
self,
block: &BlockInfo,
id: u64,
) -> StdResult<ProposalResponse>
pub fn into_response( self, block: &BlockInfo, id: u64, ) -> StdResult<ProposalResponse>
Consumes the proposal and returns a version which may be used in a query response. The difference being that proposal statuses are only updated on vote, execute, and close events. It is possible though that since a vote has occured the proposal expiring has changed its status. This method recomputes the status so that queries get accurate information.
Sourcepub fn current_status(&self, block: &BlockInfo) -> StdResult<Status>
pub fn current_status(&self, block: &BlockInfo) -> StdResult<Status>
Gets the current status of the proposal.
Sourcepub fn update_status(&mut self, block: &BlockInfo) -> StdResult<()>
pub fn update_status(&mut self, block: &BlockInfo) -> StdResult<()>
Sets a proposals status to its current status.
Sourcepub fn is_passed(&self, block: &BlockInfo) -> StdResult<bool>
pub fn is_passed(&self, block: &BlockInfo) -> StdResult<bool>
Returns true iff this proposal is sure to pass (even before expiration if no future sequence of possible votes can cause it to fail). Passing in the case of multiple choice proposals means that quorum has been met, one of the options that is not “None of the above” has won the most votes, and there is no tie.
pub fn is_rejected(&self, block: &BlockInfo) -> StdResult<bool>
Sourcepub fn calculate_vote_result(&self) -> StdResult<VoteResult>
pub fn calculate_vote_result(&self) -> StdResult<VoteResult>
Find the option with the highest vote weight, and note if there is a tie.
Trait Implementations§
Source§impl Clone for MultipleChoiceProposal
impl Clone for MultipleChoiceProposal
Source§fn clone(&self) -> MultipleChoiceProposal
fn clone(&self) -> MultipleChoiceProposal
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MultipleChoiceProposal
impl Debug for MultipleChoiceProposal
Source§impl<'de> Deserialize<'de> for MultipleChoiceProposal
impl<'de> Deserialize<'de> for MultipleChoiceProposal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for MultipleChoiceProposal
impl JsonSchema for MultipleChoiceProposal
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more