Benchmark Collective Pallet (#5343)

* Init

* Fix execute.

* Duplicate macro for instances temporarilly

* Add propose.

* Add vote, close.

* Propose from own module

* Add old members to set_members.

* Add previous proposals to propose.

* Compress a bit the macro.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Marcio Diaz
2020-03-24 18:06:29 +01:00
committed by GitHub
parent 27fe4206ed
commit 22e23b0103
8 changed files with 429 additions and 28 deletions
+5 -2
View File
@@ -48,6 +48,9 @@ use frame_support::{
};
use frame_system::{self as system, ensure_signed, ensure_root};
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
/// Simple index type for proposal counting.
pub type ProposalIndex = u32;
@@ -57,12 +60,12 @@ pub type ProposalIndex = u32;
/// vote exactly once, therefore also the number of votes for any given motion.
pub type MemberCount = u32;
pub trait Trait<I=DefaultInstance>: frame_system::Trait {
pub trait Trait<I: Instance=DefaultInstance>: frame_system::Trait {
/// The outer origin type.
type Origin: From<RawOrigin<Self::AccountId, I>>;
/// The outer call dispatch type.
type Proposal: Parameter + Dispatchable<Origin=<Self as Trait<I>>::Origin>;
type Proposal: Parameter + Dispatchable<Origin=<Self as Trait<I>>::Origin> + From<Call<Self, I>>;
/// The outer event type.
type Event: From<Event<Self, I>> + Into<<Self as frame_system::Trait>::Event>;