referrerpolicy=no-referrer-when-downgrade

Trait pallet_alliance::ProposalProvider

source ·
pub trait ProposalProvider<AccountId, Hash, Proposal> {
    // Required methods
    fn propose_proposal(
        who: AccountId,
        threshold: u32,
        proposal: Box<Proposal>,
        length_bound: u32,
    ) -> Result<(u32, u32), DispatchError>;
    fn vote_proposal(
        who: AccountId,
        proposal: Hash,
        index: ProposalIndex,
        approve: bool,
    ) -> Result<bool, DispatchError>;
    fn close_proposal(
        proposal_hash: Hash,
        index: ProposalIndex,
        proposal_weight_bound: Weight,
        length_bound: u32,
    ) -> DispatchResultWithPostInfo;
    fn proposal_of(proposal_hash: Hash) -> Option<Proposal>;
}
Expand description

The provider of a collective action interface, for example an instance of pallet-collective.

Required Methods§

source

fn propose_proposal( who: AccountId, threshold: u32, proposal: Box<Proposal>, length_bound: u32, ) -> Result<(u32, u32), DispatchError>

Add a new proposal. Returns a proposal length and active proposals count if successful.

source

fn vote_proposal( who: AccountId, proposal: Hash, index: ProposalIndex, approve: bool, ) -> Result<bool, DispatchError>

Add an aye or nay vote for the sender to the given proposal. Returns true if the sender votes first time if successful.

source

fn close_proposal( proposal_hash: Hash, index: ProposalIndex, proposal_weight_bound: Weight, length_bound: u32, ) -> DispatchResultWithPostInfo

Close a proposal that is either approved, disapproved, or whose voting period has ended.

source

fn proposal_of(proposal_hash: Hash) -> Option<Proposal>

Return a proposal of the given hash.

Object Safety§

This trait is not object safe.

Implementors§