From 40e201e061710e1f85d7d743983ff6703dd4aae9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:40:33 -0500 Subject: [PATCH] refactor: use a more straightforward return value (backport #23718) (#23875) Co-authored-by: fuyangpengqi <167312867+fuyangpengqi@users.noreply.github.com> Co-authored-by: aljo242 --- x/auth/migrations/legacytx/stdsign.go | 2 +- x/staking/keeper/delegation.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/x/auth/migrations/legacytx/stdsign.go b/x/auth/migrations/legacytx/stdsign.go index e5a4e454cb..8a224ca6d7 100644 --- a/x/auth/migrations/legacytx/stdsign.go +++ b/x/auth/migrations/legacytx/stdsign.go @@ -126,7 +126,7 @@ func (ss StdSignature) MarshalYAML() (interface{}, error) { return nil, err } - return string(bz), err + return string(bz), nil } func (ss StdSignature) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 606cb1e51c..662d72b815 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -273,7 +273,11 @@ func (k Keeper) GetDelegatorUnbonding(ctx context.Context, delegator sdk.AccAddr } return false }) - return unbonding, err + if err != nil { + return unbonding, err + } + + return unbonding, nil } // IterateDelegatorUnbondingDelegations iterates through a delegator's unbonding delegations.