Enum cw_utils::Threshold [−][src]
pub enum Threshold {
AbsoluteCount {
weight: u64,
},
AbsolutePercentage {
percentage: Decimal,
},
ThresholdQuorum {
threshold: Decimal,
quorum: Decimal,
},
}
Expand description
This defines the different ways tallies can happen.
The total_weight used for calculating success as well as the weights of each
individual voter used in tallying should be snapshotted at the beginning of
the block at which the proposal starts (this is likely the responsibility of a
correct cw4 implementation).
See also ThresholdResponse
in the cw3 spec.
Variants
AbsoluteCount
Fields
weight: u64
Declares that a fixed weight of Yes votes is needed to pass.
See ThresholdResponse.AbsoluteCount
in the cw3 spec for details.
AbsolutePercentage
Fields
percentage: Decimal
Declares a percentage of the total weight that must cast Yes votes in order for
a proposal to pass.
See ThresholdResponse.AbsolutePercentage
in the cw3 spec for details.
ThresholdQuorum
Declares a quorum
of the total votes that must participate in the election in order
for the vote to be considered at all.
See ThresholdResponse.ThresholdQuorum
in the cw3 spec for details.
Implementations
returns error if this is an unreachable value, given a total weight of all members in the group
Creates a response from the saved data, just missing the total_weight info
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for Threshold
impl UnwindSafe for Threshold
Blanket Implementations
Mutably borrows from an owned value. Read more