[][src]Enum cw3::ThresholdResponse

pub enum ThresholdResponse {
    AbsoluteCount {
        weight_needed: u64,
        total_weight: u64,
    },
    AbsolutePercentage {
        percentage_needed: Decimal,
        total_weight: u64,
    },
    ThresholdQuora {
        threshold: Decimal,
        quroum: Decimal,
        total_weight: u64,
    },
}

This defines the different ways tallies can happen. It can be extended as needed, but once the spec is frozen, these should not be modified. They are designed to be general.

Variants

AbsoluteCount

Declares a total weight needed to pass This usually implies that count_needed is stable, even if total_weight changes eg. 3 of 5 multisig -> 3 of 6 multisig

Fields of AbsoluteCount

weight_needed: u64total_weight: u64
AbsolutePercentage

Declares a percentage of the total weight needed to pass This implies the percentage is stable, when total_weight changes eg. at 50.1%, we go from needing 51/100 to needing 101/200

Note: percentage_needed = 60% is different than threshold = 60%, quora = 100% as the first will pass with 60% yes votes and 10% no votes, while the second will require the others to vote anything (no, abstain...) to pass

Fields of AbsolutePercentage

percentage_needed: Decimaltotal_weight: u64
ThresholdQuora

Declares a threshold (minimum percentage of votes that must approve) and a quorum (minimum percentage of voter weight that must vote). This allows eg. 25% of total weight YES to pass, if we have quorum of 40% and threshold of 51% and most of the people sit out the election. This is more common in general elections where participation is expected to be low.

Fields of ThresholdQuora

threshold: Decimalquroum: Decimaltotal_weight: u64

Trait Implementations

impl Clone for ThresholdResponse[src]

impl Debug for ThresholdResponse[src]

impl<'de> Deserialize<'de> for ThresholdResponse[src]

impl JsonSchema for ThresholdResponse[src]

impl PartialEq<ThresholdResponse> for ThresholdResponse[src]

impl Serialize for ThresholdResponse[src]

impl StructuralPartialEq for ThresholdResponse[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.