sudo_as should return a result (#7620)

This commit is contained in:
Shawn Tabrizi
2020-11-30 04:57:15 -08:00
committed by GitHub
parent 007254c957
commit 7753a2250f
2 changed files with 4 additions and 10 deletions
+3 -9
View File
@@ -214,15 +214,9 @@ decl_module! {
let who = T::Lookup::lookup(who)?;
let res = match call.dispatch_bypass_filter(frame_system::RawOrigin::Signed(who).into()) {
Ok(_) => true,
Err(e) => {
sp_runtime::print(e);
false
}
};
let res = call.dispatch_bypass_filter(frame_system::RawOrigin::Signed(who).into());
Self::deposit_event(RawEvent::SudoAsDone(res));
Self::deposit_event(RawEvent::SudoAsDone(res.map(|_| ()).map_err(|e| e.error)));
// Sudo user does not pay a fee.
Ok(Pays::No.into())
}
@@ -236,7 +230,7 @@ decl_event!(
/// The \[sudoer\] just switched identity; the old key is supplied.
KeyChanged(AccountId),
/// A sudo just took place. \[result\]
SudoAsDone(bool),
SudoAsDone(DispatchResult),
}
);