From b118a0adac76cb6478953a8528a192e3b21cab27 Mon Sep 17 00:00:00 2001 From: Tom <54514587+GAtom22@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:27:14 -0300 Subject: [PATCH] fix(staking): fix impossible conditions (#19621) --- x/staking/keeper/delegation.go | 2 +- x/staking/keeper/query_utils.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index b88b17cd57f8..606cb1e51c89 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -1031,7 +1031,7 @@ func (k Keeper) Unbond( } valAddr, err1 := k.validatorAddressCodec.StringToBytes(delegation.GetValidatorAddr()) - if err != nil { + if err1 != nil { return amount, err1 } diff --git a/x/staking/keeper/query_utils.go b/x/staking/keeper/query_utils.go index 5754ef990c0b..4b089da7800a 100644 --- a/x/staking/keeper/query_utils.go +++ b/x/staking/keeper/query_utils.go @@ -41,10 +41,6 @@ func (k Keeper) GetDelegatorValidators( i++ } - if err != nil { - return types.Validators{}, err - } - return types.Validators{Validators: validators[:i], ValidatorCodec: k.validatorAddressCodec}, nil // trim }