mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
Migrate membership, nicks, scored-pool and session to decl_error (#4463)
* Migrate membership, nicks, scored-pool and session to decl_error * Fix tests * Update frame/scored-pool/src/tests.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Remove InsufficientBalance error from scored-pool * Replace Error::<Test, DefaultInstance> with Error::<Test, _> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
committed by
Shawn Tabrizi
parent
9950ea98fc
commit
328563f8d4
@@ -794,8 +794,6 @@ decl_error! {
|
||||
AlreadyBonded,
|
||||
/// Controller is already paired.
|
||||
AlreadyPaired,
|
||||
/// Should be the root origin or the `T::SlashCancelOrigin`.
|
||||
BadOrigin,
|
||||
/// Targets cannot be empty.
|
||||
EmptyTargets,
|
||||
/// Duplicate index.
|
||||
@@ -1190,8 +1188,7 @@ decl_module! {
|
||||
fn cancel_deferred_slash(origin, era: EraIndex, slash_indices: Vec<u32>) {
|
||||
T::SlashCancelOrigin::try_origin(origin)
|
||||
.map(|_| ())
|
||||
.or_else(ensure_root)
|
||||
.map_err(|_| Error::<T>::BadOrigin)?;
|
||||
.or_else(ensure_root)?;
|
||||
|
||||
let mut slash_indices = slash_indices;
|
||||
slash_indices.sort_unstable();
|
||||
|
||||
Reference in New Issue
Block a user