pub struct Proposal {
pub title: String,
pub description: String,
pub start_height: u64,
pub expires: Expiration,
pub msgs: Vec<CosmosMsg<Empty>>,
pub status: Status,
pub threshold: Threshold,
pub total_weight: u64,
pub votes: Votes,
pub proposer: Addr,
pub deposit: Option<DepositInfo>,
}
Fields§
§title: String
§description: String
§start_height: u64
§expires: Expiration
§msgs: Vec<CosmosMsg<Empty>>
§status: Status
§threshold: Threshold
pass requirements
total_weight: u64
§votes: Votes
§proposer: Addr
The address that created the proposal.
deposit: Option<DepositInfo>
The deposit that was paid along with this proposal. This may be refunded upon proposal completion.
Implementations§
Source§impl Proposal
impl Proposal
Sourcepub fn current_status(&self, block: &BlockInfo) -> Status
pub fn current_status(&self, block: &BlockInfo) -> Status
current_status is non-mutable and returns what the status should be. (designed for queries)
Sourcepub fn update_status(&mut self, block: &BlockInfo)
pub fn update_status(&mut self, block: &BlockInfo)
update_status sets the status of the proposal to current_status. (designed for handler logic)
Sourcepub fn is_passed(&self, block: &BlockInfo) -> bool
pub fn is_passed(&self, block: &BlockInfo) -> bool
Returns true if this proposal is sure to pass (even before expiration, if no future sequence of possible votes could cause it to fail).
Sourcepub fn is_rejected(&self, block: &BlockInfo) -> bool
pub fn is_rejected(&self, block: &BlockInfo) -> bool
Returns true if this proposal is sure to be rejected (even before expiration, if no future sequence of possible votes could cause it to pass).
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Proposal
impl JsonSchema for Proposal
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreimpl StructuralPartialEq for Proposal
Auto Trait Implementations§
impl Freeze for Proposal
impl RefUnwindSafe for Proposal
impl Send for Proposal
impl Sync for Proposal
impl Unpin for Proposal
impl UnwindSafe for Proposal
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<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