[][src]Enum pallet_democracy::Call

pub enum Call<T: Trait> {
    propose(T::Hash, <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance),
    second(PropIndexu32),
    vote(ReferendumIndexAccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>),
    emergency_cancel(ReferendumIndex),
    external_propose(T::Hash),
    external_propose_majority(T::Hash),
    external_propose_default(T::Hash),
    fast_track(T::Hash, T::BlockNumber, T::BlockNumber),
    veto_external(T::Hash),
    cancel_referendum(ReferendumIndex),
    cancel_queued(ReferendumIndex),
    delegate(T::AccountIdConviction, <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance),
    undelegate(),
    clear_public_proposals(),
    note_preimage(Vec<u8>),
    note_preimage_operational(Vec<u8>),
    note_imminent_preimage(Vec<u8>),
    note_imminent_preimage_operational(Vec<u8>),
    reap_preimage(T::Hashu32),
    unlock(T::AccountId),
    remove_vote(ReferendumIndex),
    remove_other_vote(T::AccountIdReferendumIndex),
    enact_proposal(T::HashReferendumIndex),
    // some variants omitted
}

Dispatchable calls.

Each variant of this enum maps to a dispatchable function from the associated module.

Variants

propose(T::Hash, <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance)

Propose a sensitive action to be taken.

The dispatch origin of this call must be Signed and the sender must have funds to cover the deposit.

  • proposal_hash: The hash of the proposal preimage.
  • value: The amount of deposit (must be at least MinimumDeposit).

Emits Proposed.

  • Complexity: O(1)
  • Db reads: PublicPropCount, PublicProps
  • Db writes: PublicPropCount, PublicProps, DepositOf

second(PropIndexu32)

Signals agreement with a particular proposal.

The dispatch origin of this call must be Signed and the sender must have funds to cover the deposit, equal to the original deposit.

  • proposal: The index of the proposal to second.
  • seconds_upper_bound: an upper bound on the current number of seconds on this proposal. Extrinsic is weighted according to this value with no refund.

  • Complexity: O(S) where S is the number of seconds a proposal already has.
  • Db reads: DepositOf
  • Db writes: DepositOf

Vote in a referendum. If vote.is_aye(), the vote is to enact the proposal; otherwise it is a vote to keep the status quo.

The dispatch origin of this call must be Signed.

  • ref_index: The index of the referendum to vote for.
  • vote: The vote configuration.

  • Complexity: O(R) where R is the number of referendums the voter has voted on. weight is charged as if maximum votes.
  • Db reads: ReferendumInfoOf, VotingOf, balances locks
  • Db writes: ReferendumInfoOf, VotingOf, balances locks

emergency_cancel(ReferendumIndex)

Schedule an emergency cancellation of a referendum. Cannot happen twice to the same referendum.

The dispatch origin of this call must be CancellationOrigin.

-ref_index: The index of the referendum to cancel.

  • Complexity: O(1).
  • Db reads: ReferendumInfoOf, Cancellations
  • Db writes: ReferendumInfoOf, Cancellations

external_propose(T::Hash)

Schedule a referendum to be tabled once it is legal to schedule an external referendum.

The dispatch origin of this call must be ExternalOrigin.

  • proposal_hash: The preimage hash of the proposal.

  • Complexity O(V) with V number of vetoers in the blacklist of proposal. Decoding vec of length V. Charged as maximum
  • Db reads: NextExternal, Blacklist
  • Db writes: NextExternal

external_propose_majority(T::Hash)

Schedule a majority-carries referendum to be tabled next once it is legal to schedule an external referendum.

The dispatch of this call must be ExternalMajorityOrigin.

  • proposal_hash: The preimage hash of the proposal.

Unlike external_propose, blacklisting has no effect on this and it may replace a pre-scheduled external_propose call.

  • Complexity: O(1)
  • Db write: NextExternal

external_propose_default(T::Hash)

Schedule a negative-turnout-bias referendum to be tabled next once it is legal to schedule an external referendum.

The dispatch of this call must be ExternalDefaultOrigin.

  • proposal_hash: The preimage hash of the proposal.

Unlike external_propose, blacklisting has no effect on this and it may replace a pre-scheduled external_propose call.

  • Complexity: O(1)
  • Db write: NextExternal

fast_track(T::Hash, T::BlockNumber, T::BlockNumber)

Schedule the currently externally-proposed majority-carries referendum to be tabled immediately. If there is no externally-proposed referendum currently, or if there is one but it is not a majority-carries referendum then it fails.

The dispatch of this call must be FastTrackOrigin.

  • proposal_hash: The hash of the current external proposal.
  • voting_period: The period that is allowed for voting on this proposal. Increased to FastTrackVotingPeriod if too low.
  • delay: The number of block after voting has ended in approval and this should be enacted. This doesn't have a minimum amount.

Emits Started.

  • Complexity: O(1)
  • Db reads: NextExternal, ReferendumCount
  • Db writes: NextExternal, ReferendumCount, ReferendumInfoOf
  • Base Weight: 30.1 µs

veto_external(T::Hash)

Veto and blacklist the external proposal hash.

The dispatch origin of this call must be VetoOrigin.

  • proposal_hash: The preimage hash of the proposal to veto and blacklist.

Emits Vetoed.

  • Complexity: O(V + log(V)) where V is number of existing vetoers Performs a binary search on existing_vetoers which should not be very large.
  • Db reads: NextExternal, Blacklist
  • Db writes: NextExternal, Blacklist

cancel_referendum(ReferendumIndex)

Remove a referendum.

The dispatch origin of this call must be Root.

  • ref_index: The index of the referendum to cancel.

  • Complexity: O(1).
  • Db writes: ReferendumInfoOf

cancel_queued(ReferendumIndex)

Cancel a proposal queued for enactment.

The dispatch origin of this call must be Root.

  • which: The index of the referendum to cancel.

  • O(D) where D is the items in the dispatch queue. Weighted as D = 10.
  • Db reads: scheduler lookup, scheduler agenda`
  • Db writes: scheduler lookup, scheduler agenda`

delegate(T::AccountIdConviction, <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance)

Delegate the voting power (with some given conviction) of the sending account.

The balance delegated is locked for as long as it's delegated, and thereafter for the time appropriate for the conviction's lock period.

The dispatch origin of this call must be Signed, and the signing account must either:

  • be delegating already; or

  • have no voting activity (if there is, then it will need to be removed/consolidated through reap_vote or unvote).

  • to: The account whose voting the target account's voting power will follow.

  • conviction: The conviction that will be attached to the delegated votes. When the account is undelegated, the funds will be locked for the corresponding period.

  • balance: The amount of the account's balance to be used in delegating. This must not be more than the account's current balance.

Emits Delegated.

  • Complexity: O(R) where R is the number of referendums the voter delegating to has voted on. Weight is charged as if maximum votes.
  • Db reads: 3*VotingOf, origin account locks
  • Db writes: 3*VotingOf, origin account locks
  • Db reads per votes: ReferendumInfoOf
  • Db writes per votes: ReferendumInfoOf

undelegate()

Undelegate the voting power of the sending account.

Tokens may be unlocked following once an amount of time consistent with the lock period of the conviction with which the delegation was issued.

The dispatch origin of this call must be Signed and the signing account must be currently delegating.

Emits Undelegated.

  • Complexity: O(R) where R is the number of referendums the voter delegating to has voted on. Weight is charged as if maximum votes.
  • Db reads: 2*VotingOf
  • Db writes: 2*VotingOf
  • Db reads per votes: ReferendumInfoOf
  • Db writes per votes: ReferendumInfoOf

clear_public_proposals()

Clears all public proposals.

The dispatch origin of this call must be Root.

  • O(1).
  • Db writes: PublicProps

note_preimage(Vec<u8>)

Register the preimage for an upcoming proposal. This doesn't require the proposal to be in the dispatch queue but does require a deposit, returned once enacted.

The dispatch origin of this call must be Signed.

  • encoded_proposal: The preimage of a proposal.

Emits PreimageNoted.

  • Complexity: O(E) with E size of encoded_proposal (protected by a required deposit).
  • Db reads: Preimages
  • Db writes: Preimages

note_preimage_operational(Vec<u8>)

Same as note_preimage but origin is OperationalPreimageOrigin.

note_imminent_preimage(Vec<u8>)

Register the preimage for an upcoming proposal. This requires the proposal to be in the dispatch queue. No deposit is needed. When this call is successful, i.e. the preimage has not been uploaded before and matches some imminent proposal, no fee is paid.

The dispatch origin of this call must be Signed.

  • encoded_proposal: The preimage of a proposal.

Emits PreimageNoted.

  • Complexity: O(E) with E size of encoded_proposal (protected by a required deposit).
  • Db reads: Preimages
  • Db writes: Preimages

note_imminent_preimage_operational(Vec<u8>)

Same as note_imminent_preimage but origin is OperationalPreimageOrigin.

reap_preimage(T::Hashu32)

Remove an expired proposal preimage and collect the deposit.

The dispatch origin of this call must be Signed.

  • proposal_hash: The preimage hash of a proposal.
  • proposal_length_upper_bound: an upper bound on length of the proposal. Extrinsic is weighted according to this value with no refund.

This will only work after VotingPeriod blocks from the time that the preimage was noted, if it's the same account doing it. If it's a different account, then it'll only work an additional EnactmentPeriod later.

Emits PreimageReaped.

  • Complexity: O(D) where D is length of proposal.
  • Db reads: Preimages, provider account data
  • Db writes: Preimages provider account data

unlock(T::AccountId)

Unlock tokens that have an expired lock.

The dispatch origin of this call must be Signed.

  • target: The account to remove the lock on.

  • Complexity O(R) with R number of vote of target.
  • Db reads: VotingOf, balances locks, target account
  • Db writes: VotingOf, balances locks, target account

remove_vote(ReferendumIndex)

Remove a vote for a referendum.

If:

  • the referendum was cancelled, or
  • the referendum is ongoing, or
  • the referendum has ended such that
    • the vote of the account was in opposition to the result; or
    • there was no conviction to the account's vote; or
    • the account made a split vote ...then the vote is removed cleanly and a following call to unlock may result in more funds being available.

If, however, the referendum has ended and:

  • it finished corresponding to the vote of the account, and
  • the account made a standard vote with conviction, and
  • the lock period of the conviction is not over ...then the lock will be aggregated into the overall account's lock, which may involve overlocking (where the two locks are combined into a single lock that is the maximum of both the amount locked and the time is it locked for).

The dispatch origin of this call must be Signed, and the signer must have a vote registered for referendum index.

  • index: The index of referendum of the vote to be removed.

  • O(R + log R) where R is the number of referenda that target has voted on. Weight is calculated for the maximum number of vote.
  • Db reads: ReferendumInfoOf, VotingOf
  • Db writes: ReferendumInfoOf, VotingOf

remove_other_vote(T::AccountIdReferendumIndex)

Remove a vote for a referendum.

If the target is equal to the signer, then this function is exactly equivalent to remove_vote. If not equal to the signer, then the vote must have expired, either because the referendum was cancelled, because the voter lost the referendum or because the conviction period is over.

The dispatch origin of this call must be Signed.

  • target: The account of the vote to be removed; this account must have voted for referendum index.
  • index: The index of referendum of the vote to be removed.

  • O(R + log R) where R is the number of referenda that target has voted on. Weight is calculated for the maximum number of vote.
  • Db reads: ReferendumInfoOf, VotingOf
  • Db writes: ReferendumInfoOf, VotingOf

enact_proposal(T::HashReferendumIndex)

Enact a proposal from a referendum. For now we just make the weight be the maximum.

Trait Implementations

impl<T: Trait> Clone for Call<T>[src]

impl<T: Trait> Debug for Call<T>[src]

impl<T: Trait> Decode for Call<T> where
    T::Hash: Decode,
    T::Hash: Decode,
    AccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>: Decode,
    AccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::BlockNumber: Decode,
    T::BlockNumber: Decode,
    T::BlockNumber: Decode,
    T::BlockNumber: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Decode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::AccountId: Decode,
    T::Hash: Decode,
    T::Hash: Decode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: HasCompact
[src]

impl<T: Trait> Encode for Call<T> where
    T::Hash: Encode,
    T::Hash: Encode,
    AccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>: Encode,
    AccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::BlockNumber: Encode,
    T::BlockNumber: Encode,
    T::BlockNumber: Encode,
    T::BlockNumber: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Encode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: HasCompact
[src]

impl<T: Trait> EncodeLike<Call<T>> for Call<T> where
    T::Hash: Encode,
    T::Hash: Encode,
    AccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>: Encode,
    AccountVote<<<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance>: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::BlockNumber: Encode,
    T::BlockNumber: Encode,
    T::BlockNumber: Encode,
    T::BlockNumber: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Encode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    T::AccountId: Encode,
    T::Hash: Encode,
    T::Hash: Encode,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: HasCompact
[src]

impl<T: Trait> Eq for Call<T>[src]

impl<T: Trait> GetCallName for Call<T>[src]

impl<T: Trait> GetDispatchInfo for Call<T>[src]

impl<T: Trait> PartialEq<Call<T>> for Call<T>[src]

impl<T: Trait> UnfilteredDispatchable for Call<T>[src]

type Origin = T::Origin

The origin type of the runtime, (i.e. frame_system::Trait::Origin).

Auto Trait Implementations

impl<T> RefUnwindSafe for Call<T> where
    T: RefUnwindSafe,
    <T as Trait>::AccountId: RefUnwindSafe,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: RefUnwindSafe,
    <T as Trait>::BlockNumber: RefUnwindSafe,
    <T as Trait>::Currency: Currency<<T as Trait>::AccountId>,
    <T as Trait>::Hash: RefUnwindSafe

impl<T> Send for Call<T> where
    T: Send,
    <T as Trait>::AccountId: Send,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Send,
    <T as Trait>::BlockNumber: Send,
    <T as Trait>::Currency: Currency<<T as Trait>::AccountId>,
    <T as Trait>::Hash: Send

impl<T> Sync for Call<T> where
    T: Sync,
    <T as Trait>::AccountId: Sync,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Sync,
    <T as Trait>::BlockNumber: Sync,
    <T as Trait>::Currency: Currency<<T as Trait>::AccountId>,
    <T as Trait>::Hash: Sync

impl<T> Unpin for Call<T> where
    T: Unpin,
    <T as Trait>::AccountId: Unpin,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: Unpin,
    <T as Trait>::BlockNumber: Unpin,
    <T as Trait>::Currency: Currency<<T as Trait>::AccountId>,
    <T as Trait>::Hash: Unpin

impl<T> UnwindSafe for Call<T> where
    T: UnwindSafe,
    <T as Trait>::AccountId: UnwindSafe,
    <<T as Trait>::Currency as Currency<<T as Trait>::AccountId>>::Balance: UnwindSafe,
    <T as Trait>::BlockNumber: UnwindSafe,
    <T as Trait>::Currency: Currency<<T as Trait>::AccountId>,
    <T as Trait>::Hash: 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<S> Codec for S where
    S: Encode + Decode
[src]

impl<T, X> Decode for X where
    T: Decode + Into<X>,
    X: WrapperTypeDecode<Wrapped = T>, 
[src]

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

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

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

impl<T, X> Encode for X where
    T: Encode + ?Sized,
    X: WrapperTypeEncode<Target = T>, 
[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>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[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, 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
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 

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

Get a reference to the inner from the outer.

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 + Clone + PartialEq<T> + Eq + Send + Sync + Debug
[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
    S: TryInto<T>,
    T: Bounded

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