Skip to content

Commit 38b778f

Browse files
authored
chore(staking): remove intermediate code of audit fix (#32)
* chore(staking): remove intermediate code of audit fix * chore(staking): unit test
1 parent badc47d commit 38b778f

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

x/staking/keeper/unbonding.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ import (
1010
"github.com/cosmos/cosmos-sdk/x/staking/types"
1111
)
1212

13-
func (k Keeper) GetOldUnbondingID(ctx context.Context) (unbondingID uint64, err error) {
14-
store := k.storeService.OpenKVStore(ctx)
15-
// Old UnbondingID used same key as period delegation
16-
bz, err := store.Get(types.PeriodDelegationKey)
17-
if err != nil {
18-
return 0, err
19-
}
20-
21-
if bz != nil {
22-
unbondingID = binary.BigEndian.Uint64(bz)
23-
}
24-
25-
return unbondingID, err
26-
}
27-
28-
func (k Keeper) RemoveOldUnbondingID(ctx context.Context) error {
29-
store := k.storeService.OpenKVStore(ctx)
30-
// Old UnbondingID used same key as period delegation, which is not used independently.
31-
return store.Delete(types.PeriodDelegationKey)
32-
}
33-
3413
func (k Keeper) GetUnbondingID(ctx context.Context) (unbondingID uint64, err error) {
3514
store := k.storeService.OpenKVStore(ctx)
3615
bz, err := store.Get(types.UnbondingIDKey)

x/staking/migrations/v3/json_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ func TestMigrateJSON(t *testing.T) {
5656
"rewards_multiplier": "1.000000000000000000"
5757
},
5858
{
59-
"duration": "2592000s",
59+
"duration": "7776000s",
6060
"period_type": 1,
6161
"rewards_multiplier": "1.051000000000000000"
6262
},
6363
{
64-
"duration": "31536000s",
64+
"duration": "31104000s",
6565
"period_type": 2,
6666
"rewards_multiplier": "1.160000000000000000"
6767
},

0 commit comments

Comments
 (0)