Skip to content

Commit 33192dd

Browse files
fix: update redelegation stringer (#14064)
* fix: update redelegation stringer * updates * space instead of tab * Update x/staking/types/delegation.go Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> * add changelog Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
1 parent 0d5a7f8 commit 33192dd

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4848

4949
### Bug Fixes
5050

51+
* (x/staking) [#14064](https://github.com/cosmos/cosmos-sdk/pull/14064) Set all fields in `redelegation.String()`.
5152
* (x/upgrade) [#13936](https://github.com/cosmos/cosmos-sdk/pull/13936) Make downgrade verification work again.
5253
* (x/group) [#13742](https://github.com/cosmos/cosmos-sdk/pull/13742) Fix `validate-genesis` when group policy accounts exist.
5354
* (baseapp) [#14049](https://github.com/cosmos/cosmos-sdk/pull/14049) Fix state sync when interval is zero.

x/staking/types/delegation.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,13 @@ func (red Redelegation) String() string {
322322

323323
for i, entry := range red.Entries {
324324
out += fmt.Sprintf(` Redelegation Entry #%d:
325-
Creation height: %v
326-
Min time to unbond (unix): %v
327-
Dest Shares: %s
325+
Creation height: %v
326+
Min time to unbond (unix): %v
327+
Dest Shares: %s
328+
Unbonding ID: %d
329+
Unbonding Ref Count: %d
328330
`,
329-
i, entry.CreationHeight, entry.CompletionTime, entry.SharesDst,
331+
i, entry.CreationHeight, entry.CompletionTime, entry.SharesDst, entry.UnbondingId, entry.UnbondingOnHoldRefCount,
330332
)
331333
}
332334

x/staking/types/delegation_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ func TestRedelegationEqual(t *testing.T) {
6161
r2 := types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0,
6262
time.Unix(0, 0), sdk.NewInt(0),
6363
math.LegacyNewDec(0), 2)
64-
65-
ok := r1.String() == r2.String()
66-
require.True(t, ok)
64+
require.False(t, r1.String() == r2.String())
65+
r2 = types.NewRedelegation(sdk.AccAddress(valAddr1), valAddr2, valAddr3, 0,
66+
time.Unix(0, 0), sdk.NewInt(0),
67+
math.LegacyNewDec(0), 1)
68+
require.True(t, r1.String() == r2.String())
6769

6870
r2.Entries[0].SharesDst = math.LegacyNewDec(10)
6971
r2.Entries[0].CompletionTime = time.Unix(20*20*2, 0)
70-
71-
ok = r1.String() == r2.String()
72-
require.False(t, ok)
72+
require.False(t, r1.String() == r2.String())
7373
}
7474

7575
func TestRedelegationString(t *testing.T) {

0 commit comments

Comments
 (0)