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: Addr

The address that created this proposal.

§start_height: u64

The 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: Expiration

The the time at which this proposal will expire and close for additional votes.

§threshold: Threshold

The threshold at which this proposal will pass.

§total_power: Uint128

The 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

source

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.

source

pub fn current_status(&self, block: &BlockInfo) -> Status

Gets the current status of the proposal.

source

pub fn update_status(&mut self, block: &BlockInfo)

Sets a proposals status to its current status.

source

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).

source

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 Clone for Proposal

source§

fn clone(&self) -> Proposal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Proposal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Proposal

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for Proposal

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl PartialEq<Proposal> for Proposal

source§

fn eq(&self, other: &Proposal) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Proposal

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Proposal

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,