mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 02:21:14 +00:00
allow defensive operations to take a proof (#11353)
* allow defensive operations to take a proof * Update frame/support/src/traits/misc.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update frame/bags-list/src/list/mod.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Update frame/support/src/traits/misc.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Update frame/support/src/traits/misc.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Fix build * fix build again * fmt Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -56,7 +56,7 @@ use crate::{
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{
|
||||
ensure,
|
||||
traits::{Currency, Get, Imbalance, OnUnbalanced},
|
||||
traits::{Currency, Defensive, Get, Imbalance, OnUnbalanced},
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
@@ -600,8 +600,8 @@ pub fn do_slash<T: Config>(
|
||||
slashed_imbalance: &mut NegativeImbalanceOf<T>,
|
||||
slash_era: EraIndex,
|
||||
) {
|
||||
let controller = match <Pallet<T>>::bonded(stash) {
|
||||
None => return, // defensive: should always exist.
|
||||
let controller = match <Pallet<T>>::bonded(stash).defensive() {
|
||||
None => return,
|
||||
Some(c) => c,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user