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:
Kian Paimani
2022-05-06 14:25:07 +01:00
committed by GitHub
parent 9d57a674d7
commit e30c18d61d
3 changed files with 36 additions and 5 deletions
+2 -2
View File
@@ -443,8 +443,8 @@ impl<T: Config<I>, I: 'static> List<T, I> {
// remove the heavier node from this list. Note that this removes the node from storage and
// decrements the node counter.
// defensive: both nodes have been checked to exist.
let _ = Self::remove(&heavier_id).defensive();
let _ =
Self::remove(&heavier_id).defensive_proof("both nodes have been checked to exist; qed");
// re-fetch `lighter_node` from storage since it may have been updated when `heavier_node`
// was removed.