Council motions for approving treasury proposals (#694)

* Treasury in runtime, generic approve/reject

* Add logic for council origin

* Add tests.

* Configurable number of members in EnsureMembers

* Fix grumbles

* Fix spelling

* Comment
This commit is contained in:
Gav Wood
2018-09-10 16:02:59 +02:00
committed by GitHub
parent 7b112dee7c
commit bcc26dd30a
26 changed files with 678 additions and 47 deletions
@@ -45,7 +45,7 @@ extern crate safe_mix;
use rstd::prelude::*;
use primitives::traits::{self, CheckEqual, SimpleArithmetic, SimpleBitOps, Zero, One, Bounded,
Hash, Member, MaybeDisplay};
Hash, Member, MaybeDisplay, EnsureOrigin};
use runtime_support::{StorageValue, StorageMap, Parameter};
use safe_mix::TripletMix;
@@ -168,6 +168,14 @@ decl_storage! {
}
}
pub struct EnsureRoot<AccountId>(::rstd::marker::PhantomData<AccountId>);
impl<O: Into<Option<RawOrigin<AccountId>>>, AccountId> EnsureOrigin<O> for EnsureRoot<AccountId> {
type Success = ();
fn ensure_origin(o: O) -> Result<Self::Success, &'static str> {
ensure_root(o)
}
}
/// Ensure that the origin `o` represents a signed extrinsic (i.e. transaction).
/// Returns `Ok` with the account that signed the extrinsic or an `Err` otherwise.
pub fn ensure_signed<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<AccountId, &'static str>