From 60d5e8233f5586cb62bd40adc1b399618b3eddea Mon Sep 17 00:00:00 2001 From: Ankan Date: Fri, 6 Sep 2024 17:11:47 +0200 Subject: [PATCH] do not wrap a system/account error into staking::bad_state --- substrate/frame/staking/src/pallet/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/substrate/frame/staking/src/pallet/mod.rs b/substrate/frame/staking/src/pallet/mod.rs index 79f9d298ada7..8a4482f52ad5 100644 --- a/substrate/frame/staking/src/pallet/mod.rs +++ b/substrate/frame/staking/src/pallet/mod.rs @@ -1027,7 +1027,8 @@ pub mod pallet { return Err(Error::::InsufficientBond.into()) } - frame_system::Pallet::::inc_consumers(&stash).map_err(|_| Error::::BadState)?; + // Would fail if account has no provider. + frame_system::Pallet::::inc_consumers(&stash)?; let stash_balance = T::Currency::free_balance(&stash); let value = value.min(stash_balance);