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§
Sourcefn propose_proposal(
who: AccountId,
threshold: u32,
proposal: Box<Proposal>,
length_bound: u32,
) -> Result<(u32, u32), DispatchError>
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.
Sourcefn vote_proposal(
who: AccountId,
proposal: Hash,
index: ProposalIndex,
approve: bool,
) -> Result<bool, DispatchError>
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.
Sourcefn close_proposal(
proposal_hash: Hash,
index: ProposalIndex,
proposal_weight_bound: Weight,
length_bound: u32,
) -> DispatchResultWithPostInfo
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.
Sourcefn proposal_of(proposal_hash: Hash) -> Option<Proposal>
fn proposal_of(proposal_hash: Hash) -> Option<Proposal>
Return a proposal of the given hash.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.