pub struct CallApi<'api> { /* private fields */ }

Implementations

Change whether completed PIPs are pruned. Can only be called by root.

Arguments
  • prune specifies whether completed PIPs should be pruned.

Change the minimum proposal deposit amount required to start a proposal. Can only be called by root.

Arguments
  • deposit the new min deposit required to start a proposal

Change the default enactment period. Can only be called by root.

Arguments
  • duration the new default enactment period it takes for a scheduled PIP to be executed.

Change the amount of blocks after which a pending PIP is expired. If expiry is None then PIPs never expire. Can only be called by root.

Arguments
  • expiry the block-time it takes for a still-Pending PIP to expire.

Change the maximum skip count (max_pip_skip_count). Can only be called by root.

Arguments
  • max skips before a PIP cannot be skipped by GC anymore.

Change the maximum number of active PIPs before community members cannot propose anything. Can only be called by root.

Arguments
  • limit of concurrent active PIPs.

A network member creates a PIP by submitting a dispatchable which changes the network in someway. A minimum deposit is required to open a new proposal.

Arguments
  • proposer is either a signing key or committee. Used to understand whether this is a committee proposal and verified against origin.
  • proposal a dispatchable call
  • deposit minimum deposit value, which is ignored if proposer is a committee.
  • url a link to a website for proposal discussion

Vote either in favor (aye_or_nay == true) or against a PIP with id. The “convinction” or strength of the vote is given by deposit, which is reserved.

Note that vote is not additive. That is, vote(id, true, 50) followed by vote(id, true, 40) will first reserve 50 and then refund 50 - 10, ending up with 40 in deposit. To add atop of existing votes, you’ll need existing_deposit + addition.

Arguments
  • id, proposal id
  • aye_or_nay, a bool representing for or against vote
  • deposit, the “conviction” with which the vote is made.
Errors
  • NoSuchProposal if id doesn’t reference a valid PIP.
  • NotFromCommunity if proposal was made by a committee.
  • IncorrectProposalState if PIP isn’t pending.
  • InsufficientDeposit if origin cannot reserve deposit - old_deposit.

Approves the pending committee PIP given by the id.

Errors
  • BadOrigin unless a GC voting majority executes this function.
  • NoSuchProposal if the PIP with id doesn’t exist.
  • IncorrectProposalState if the proposal isn’t pending.
  • NotByCommittee if the proposal isn’t by a committee.

Rejects the PIP given by the id, refunding any bonded funds, assuming it hasn’t been cancelled or executed. Note that proposals scheduled-for-execution can also be rejected.

Errors
  • BadOrigin unless a GC voting majority executes this function.
  • NoSuchProposal if the PIP with id doesn’t exist.
  • IncorrectProposalState if the proposal was cancelled or executed.

Prune the PIP given by the id, refunding any funds not already refunded. The PIP may not be active

This function is intended for storage garbage collection purposes.

Errors
  • BadOrigin unless a GC voting majority executes this function.
  • NoSuchProposal if the PIP with id doesn’t exist.
  • IncorrectProposalState if the proposal is active.

Updates the execution schedule of the PIP given by id.

Arguments
  • until defines the future block where the enactment period will finished. None value means that enactment period is going to finish in the next block.
Errors
  • RescheduleNotByReleaseCoordinator unless triggered by release coordinator.
  • IncorrectProposalState unless the proposal was in a scheduled state.

Clears the snapshot and emits the event SnapshotCleared.

Errors
  • NotACommitteeMember - triggered when a non-GC-member executes the function.

Takes a new snapshot of the current list of active && pending PIPs. The PIPs are then sorted into a priority queue based on each PIP’s weight.

Errors
  • NotACommitteeMember - triggered when a non-GC-member executes the function.

Enacts results for the PIPs in the snapshot queue. The snapshot will be available for further enactments until it is cleared.

The results are encoded a list of (id, result) where result is applied to id. Note that the snapshot priority queue is encoded with the lowest priority first. so results = [(id, Approve)] will approve SnapshotQueue[SnapshotQueue.len() - 1].

Errors
  • BadOrigin - unless a GC voting majority executes this function.
  • CannotSkipPip - a given PIP has already been skipped too many times.
  • SnapshotResultTooLarge - on len(results) > len(snapshot_queue).
  • SnapshotIdMismatch - if:
     ∃ (i ∈ 0..SnapshotQueue.len()).
       results[i].0 ≠ SnapshotQueue[SnapshotQueue.len() - i].id
    This is protects against clearing queue while GC is voting.

Internal dispatchable that handles execution of a PIP.

Internal dispatchable that handles expiration of a PIP.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert from a value of T into an equivalent instance of Option<Self>. Read more
Consume self to return Some equivalent value of Option<T>. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Should always be Self
Convert from a value of T into an equivalent instance of Self. Read more
Consume self to return an equivalent value of T. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more