Selectable on-runtime-upgrade checks (#13045)

* Make try-runtime checks selectable

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/support/src/traits/try_runtime.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Add Clap wrapper for enum UpgradeCheckSelect

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Add Clap wrapper for enum UpgradeCheckSelect"

This reverts commit e29538c1a79d1711b43addc9400d871f6aa32844.

* fix pools sanity check

* Set default for --checks to None

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make --checks backwards comp

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add clap attr comment

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: kianenigma <kian@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-01-04 13:44:41 +01:00
committed by GitHub
parent 7ead16802e
commit d0bbec32ad
8 changed files with 79 additions and 21 deletions
+11 -6
View File
@@ -2470,12 +2470,17 @@ impl<T: Config> Pallet<T> {
for id in reward_pools {
let account = Self::create_reward_account(id);
assert!(
T::Currency::free_balance(&account) >= T::Currency::minimum_balance(),
"reward pool of {id}: {:?} (ed = {:?})",
T::Currency::free_balance(&account),
T::Currency::minimum_balance()
);
if T::Currency::free_balance(&account) < T::Currency::minimum_balance() {
log!(
warn,
"reward pool of {:?}: {:?} (ed = {:?}), should only happen because ED has \
changed recently. Pool operators should be notified to top up the reward \
account",
id,
T::Currency::free_balance(&account),
T::Currency::minimum_balance(),
)
}
}
let mut pools_members = BTreeMap::<PoolId, u32>::new();