diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb2c8348b12..593b218fe435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (x/staking) [#14064](https://github.com/cosmos/cosmos-sdk/pull/14064) Set all fields in `redelegation.String()`. * (x/upgrade) [#13936](https://github.com/cosmos/cosmos-sdk/pull/13936) Make downgrade verification work again. * (x/group) [#13742](https://github.com/cosmos/cosmos-sdk/pull/13742) Fix `validate-genesis` when group policy accounts exist. * (baseapp) [#14049](https://github.com/cosmos/cosmos-sdk/pull/14049) Fix state sync when interval is zero. diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index d763ce2c7cd4..1242e1c46182 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -322,11 +322,13 @@ func (red Redelegation) String() string { for i, entry := range red.Entries { out += fmt.Sprintf(` Redelegation Entry #%d: - Creation height: %v - Min time to unbond (unix): %v - Dest Shares: %s + Creation height: %v + Min time to unbond (unix): %v + Dest Shares: %s + Unbonding ID: %d + Unbonding Ref Count: %d `, - i, entry.CreationHeight, entry.CompletionTime, entry.SharesDst, + i, entry.CreationHeight, entry.CompletionTime, entry.SharesDst, entry.UnbondingId, entry.UnbondingOnHoldRefCount, ) } diff --git a/x/staking/types/delegation_test.go b/x/staking/types/delegation_test.go index b259f95f45d9..ae1519baa347 100644 --- a/x/staking/types/delegation_test.go +++ b/x/staking/types/delegation_test.go @@ -61,15 +61,15 @@ func TestRedelegationEqual(t *testing.T) { r2 := types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0, time.Unix(0, 0), sdk.NewInt(0), math.LegacyNewDec(0), 2) - - ok := r1.String() == r2.String() - require.True(t, ok) + require.False(t, r1.String() == r2.String()) + r2 = types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0, + time.Unix(0, 0), sdk.NewInt(0), + math.LegacyNewDec(0), 1) + require.True(t, r1.String() == r2.String()) r2.Entries[0].SharesDst = math.LegacyNewDec(10) r2.Entries[0].CompletionTime = time.Unix(20*20*2, 0) - - ok = r1.String() == r2.String() - require.False(t, ok) + require.False(t, r1.String() == r2.String()) } func TestRedelegationString(t *testing.T) {