"OR gate" for EnsureOrigin (#6237)

* 'OR gate' for EnsureOrigin.

* Formatting.

* More formatting.

* Add docstring; Update 'Success' type.

* Bump runtime impl_version.

* Fix successful_origin.

* Add either into std feature list.

* Update docs.
This commit is contained in:
Shaopeng Wang
2020-06-10 21:11:26 +12:00
committed by GitHub
parent 2729a48893
commit ccdac645c8
11 changed files with 91 additions and 63 deletions
+2 -6
View File
@@ -318,9 +318,7 @@ decl_module! {
dest: <T::Lookup as StaticLookup>::Source,
index: u32
) {
T::KickOrigin::try_origin(origin)
.map(|_| ())
.or_else(ensure_root)?;
T::KickOrigin::ensure_origin(origin)?;
let who = T::Lookup::lookup(dest)?;
@@ -344,9 +342,7 @@ decl_module! {
index: u32,
score: T::Score
) {
T::ScoreOrigin::try_origin(origin)
.map(|_| ())
.or_else(ensure_root)?;
T::ScoreOrigin::ensure_origin(origin)?;
let who = T::Lookup::lookup(dest)?;