mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
Sensible scheduling for referenda (#2753)
* Nonlinear locking and cleanups * Bump runtime version * Minor cleanup * Fix tests * Fix council tests * Fix flaw in turnout counting * Initial work on referendum schedules * Refactor council-democracy interface. * Fix build * Update srml/democracy/src/lib.rs Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com> * Update srml/democracy/src/lib.rs Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com> * Tests compile again * Tests! * Update todo * Fix build * Ensure votes arer not double-counted on member-transitions * Extra logic for normal council changes * Typo * A few grumbles addressed.
This commit is contained in:
@@ -39,7 +39,8 @@ mod system {
|
||||
use super::*;
|
||||
|
||||
pub trait Trait: 'static + Eq + Clone {
|
||||
type Origin: Into<Option<RawOrigin<Self::AccountId>>> + From<RawOrigin<Self::AccountId>>;
|
||||
type Origin: Into<Result<RawOrigin<Self::AccountId>, Self::Origin>>
|
||||
+ From<RawOrigin<Self::AccountId>>;
|
||||
type BlockNumber;
|
||||
type Digest: Digest<Hash = H256>;
|
||||
type Hash;
|
||||
@@ -100,12 +101,9 @@ mod system {
|
||||
}
|
||||
|
||||
pub fn ensure_root<OuterOrigin, AccountId>(o: OuterOrigin) -> Result<(), &'static str>
|
||||
where OuterOrigin: Into<Option<RawOrigin<AccountId>>>
|
||||
where OuterOrigin: Into<Result<RawOrigin<AccountId>, OuterOrigin>>
|
||||
{
|
||||
match o.into() {
|
||||
Some(RawOrigin::Root) => Ok(()),
|
||||
_ => Err("bad origin: expected to be a root origin"),
|
||||
}
|
||||
o.into().map(|_| ()).map_err(|_| "bad origin: expected to be a root origin")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user