Struct cw_proposal_single::proposal::Proposal
source · pub struct Proposal {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 threshold: Threshold,
pub total_power: Uint128,
pub msgs: Vec<CosmosMsg<Empty>>,
pub status: Status,
pub votes: Votes,
pub allow_revoting: bool,
pub deposit_info: Option<CheckedDepositInfo>,
}Fields§
§title: String§description: String§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.
threshold: ThresholdThe threshold at which this proposal will pass.
total_power: Uint128The total amount of voting power at the time of this proposal’s creation.
msgs: Vec<CosmosMsg<Empty>>The messages that will be executed should this proposal pass.
status: Status§votes: Votes§allow_revoting: bool§deposit_info: Option<CheckedDepositInfo>Information about the deposit that was sent as part of this proposal. None if no deposit.
Implementations§
source§impl Proposal
impl Proposal
sourcepub fn into_response(self, block: &BlockInfo, id: u64) -> ProposalResponse
pub fn into_response(self, block: &BlockInfo, id: u64) -> 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) -> Status
pub fn current_status(&self, block: &BlockInfo) -> Status
Gets the current status of the proposal.
sourcepub fn update_status(&mut self, block: &BlockInfo)
pub fn update_status(&mut self, block: &BlockInfo)
Sets a proposals status to its current status.
sourcepub fn is_passed(&self, block: &BlockInfo) -> bool
pub fn is_passed(&self, block: &BlockInfo) -> 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).
sourcepub fn is_rejected(&self, block: &BlockInfo) -> bool
pub fn is_rejected(&self, block: &BlockInfo) -> bool
As above for the passed check, used to check if a proposal is already rejected.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Proposal
impl<'de> Deserialize<'de> for Proposal
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 Proposal
impl JsonSchema for Proposal
source§fn schema_name() -> String
fn schema_name() -> String
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more