diff --git a/pallets/roles/src/lib.rs b/pallets/roles/src/lib.rs index e32ff9cba..ad643a145 100644 --- a/pallets/roles/src/lib.rs +++ b/pallets/roles/src/lib.rs @@ -267,8 +267,7 @@ pub mod pallet { ensure!(!AccountRolesMapping::::contains_key(&account), Error::::HasRoleAssigned); // chill - let _ = pallet_staking::Pallet::::chill(origin); - Ok(()) + pallet_staking::Pallet::::chill(origin) } /// Unbound funds from the stash account. @@ -296,9 +295,11 @@ pub mod pallet { ensure!(!AccountRolesMapping::::contains_key(&account), Error::::HasRoleAssigned); // Unbound funds. - let _ = pallet_staking::Pallet::::unbond(origin, amount); - - Ok(()) + let res = pallet_staking::Pallet::::unbond(origin, amount); + match res { + Ok(_) => Ok(()), + Err(dispatch_post_info) => Err(dispatch_post_info.error), + } } /// Withdraw unbound funds after un-bonding period has passed. @@ -320,9 +321,11 @@ pub mod pallet { ); // Withdraw unbound funds. - let _ = pallet_staking::Pallet::::withdraw_unbonded(origin, 0); - - Ok(()) + let res = pallet_staking::Pallet::::withdraw_unbonded(origin, 0); + match res { + Ok(_) => Ok(()), + Err(dispatch_post_info) => Err(dispatch_post_info.error), + } } } }