Enum noble_democracy::Voting[][src]

pub enum Voting<Balance, AccountId, BlockNumber> {
    Direct {
        votes: Vec<(ReferendumIndex, AccountVote<Balance>)>,
        delegations: Delegations<Balance>,
        prior: PriorLock<BlockNumber, Balance>,
    },
    Delegating {
        balance: Balance,
        target: AccountId,
        conviction: Conviction,
        delegations: Delegations<Balance>,
        prior: PriorLock<BlockNumber, Balance>,
    },
}

An indicator for what an account is doing; it can either be delegating or voting.

Variants

Direct

The account is voting directly. delegations is the total amount of post-conviction voting weight that it controls from those that have delegated to it.

Fields of Direct

votes: Vec<(ReferendumIndex, AccountVote<Balance>)>

The current votes of the account.

delegations: Delegations<Balance>

The total amount of delegations that this account has received.

prior: PriorLock<BlockNumber, Balance>

Any pre-existing locks from past voting/delegating activity.

Delegating

The account is delegating balance of its balance to a target account with conviction.

Fields of Delegating

balance: Balancetarget: AccountIdconviction: Convictiondelegations: Delegations<Balance>

The total amount of delegations that this account has received.

prior: PriorLock<BlockNumber, Balance>

Any pre-existing locks from past voting/delegating activity.

Implementations

impl<Balance: Saturating + Ord + Zero + Copy, BlockNumber: Ord + Copy + Zero, AccountId> Voting<Balance, AccountId, BlockNumber>[src]

pub fn rejig(&mut self, now: BlockNumber)[src]

pub fn locked_balance(&self) -> Balance[src]

The amount of this account’s balance that much currently be locked due to voting.

pub fn set_common(
    &mut self,
    delegations: Delegations<Balance>,
    prior: PriorLock<BlockNumber, Balance>
)
[src]

Trait Implementations

impl<Balance: Clone, AccountId: Clone, BlockNumber: Clone> Clone for Voting<Balance, AccountId, BlockNumber>[src]

impl<Balance, AccountId, BlockNumber> Debug for Voting<Balance, AccountId, BlockNumber> where
    Balance: Debug,
    AccountId: Debug,
    BlockNumber: Debug
[src]

impl<Balance, AccountId, BlockNumber> Decode for Voting<Balance, AccountId, BlockNumber> where
    Vec<(ReferendumIndex, AccountVote<Balance>)>: Decode,
    Vec<(ReferendumIndex, AccountVote<Balance>)>: Decode,
    Delegations<Balance>: Decode,
    Delegations<Balance>: Decode,
    PriorLock<BlockNumber, Balance>: Decode,
    PriorLock<BlockNumber, Balance>: Decode,
    Balance: Decode,
    Balance: Decode,
    AccountId: Decode,
    AccountId: Decode,
    Delegations<Balance>: Decode,
    Delegations<Balance>: Decode,
    PriorLock<BlockNumber, Balance>: Decode,
    PriorLock<BlockNumber, Balance>: Decode
[src]

impl<Balance: Default, AccountId, BlockNumber: Zero> Default for Voting<Balance, AccountId, BlockNumber>[src]

impl<Balance, AccountId, BlockNumber> Encode for Voting<Balance, AccountId, BlockNumber> where
    Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
    Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
    Delegations<Balance>: Encode,
    Delegations<Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode,
    Balance: Encode,
    Balance: Encode,
    AccountId: Encode,
    AccountId: Encode,
    Delegations<Balance>: Encode,
    Delegations<Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode
[src]

impl<Balance, AccountId, BlockNumber> EncodeLike<Voting<Balance, AccountId, BlockNumber>> for Voting<Balance, AccountId, BlockNumber> where
    Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
    Vec<(ReferendumIndex, AccountVote<Balance>)>: Encode,
    Delegations<Balance>: Encode,
    Delegations<Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode,
    Balance: Encode,
    Balance: Encode,
    AccountId: Encode,
    AccountId: Encode,
    Delegations<Balance>: Encode,
    Delegations<Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode,
    PriorLock<BlockNumber, Balance>: Encode
[src]

impl<Balance: Eq, AccountId: Eq, BlockNumber: Eq> Eq for Voting<Balance, AccountId, BlockNumber>[src]

impl<Balance: PartialEq, AccountId: PartialEq, BlockNumber: PartialEq> PartialEq<Voting<Balance, AccountId, BlockNumber>> for Voting<Balance, AccountId, BlockNumber>[src]

impl<T: Config> StorageMap<<T as Config>::AccountId, Voting<<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, <T as Config>::AccountId, <T as Config>::BlockNumber>> for VotingOf<T>[src]

type Query = Voting<<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, T::AccountId, T::BlockNumber>

The type that get/take returns.

type Hasher = Twox64Concat

Hasher. Used for generating final key.

impl<T: Config> StoragePrefixedMap<Voting<<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance, <T as Config>::AccountId, <T as Config>::BlockNumber>> for VotingOf<T>[src]

impl<Balance, AccountId, BlockNumber> StructuralEq for Voting<Balance, AccountId, BlockNumber>[src]

impl<Balance, AccountId, BlockNumber> StructuralPartialEq for Voting<Balance, AccountId, BlockNumber>[src]

Auto Trait Implementations

impl<Balance, AccountId, BlockNumber> RefUnwindSafe for Voting<Balance, AccountId, BlockNumber> where
    AccountId: RefUnwindSafe,
    Balance: RefUnwindSafe,
    BlockNumber: RefUnwindSafe

impl<Balance, AccountId, BlockNumber> Send for Voting<Balance, AccountId, BlockNumber> where
    AccountId: Send,
    Balance: Send,
    BlockNumber: Send

impl<Balance, AccountId, BlockNumber> Sync for Voting<Balance, AccountId, BlockNumber> where
    AccountId: Sync,
    Balance: Sync,
    BlockNumber: Sync

impl<Balance, AccountId, BlockNumber> Unpin for Voting<Balance, AccountId, BlockNumber> where
    AccountId: Unpin,
    Balance: Unpin,
    BlockNumber: Unpin

impl<Balance, AccountId, BlockNumber> UnwindSafe for Voting<Balance, AccountId, BlockNumber> where
    AccountId: UnwindSafe,
    Balance: UnwindSafe,
    BlockNumber: UnwindSafe

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> CheckedConversion for T[src]

impl<T> Clear for T where
    T: Default + Eq + PartialEq<T>, 
[src]

impl<S> Codec for S where
    S: Decode + Encode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

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

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: ToOwned + Encode
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

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

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T> Hashable for T where
    T: Codec
[src]

impl<T> Instrument for T[src]

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

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

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 

pub fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Member for T where
    T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone
[src]

impl<T> Parameter for T where
    T: Codec + EncodeLike<T> + Clone + Eq + Debug
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,