From 192d3b60920c56cfb7fd9ac56a8e1c24cad140d1 Mon Sep 17 00:00:00 2001 From: tom Date: Fri, 1 Mar 2024 13:46:44 -0300 Subject: [PATCH] fix impossible conditions --- 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 }