Skip to content

Commit

Permalink
remove duplicate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 27, 2023
1 parent 7aae97d commit 7cc6ce3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var ParamsKey = []byte{0x00}

// Migrate migrates the x/packetforward module state from the consensus version 1 to
// version 2. Specifically, it takes the parameters that are currently stored
// and managed by the x/params modules and stores them directly into the x/packetforward
Expand All @@ -28,6 +26,6 @@ func Migrate(
}

bz := cdc.MustMarshal(&currParams)
store.Set(ParamsKey, bz)
store.Set(types.ParamsKey, bz)
return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func TestMigrate(t *testing.T) {
store := ctx.KVStore(storeKey)

legacySubspace := newMockSubspace(types.Params{
FeePercentage: sdk.NewDec(0),
FeePercentage: sdk.NewDec(1),
})
require.NoError(t, v2.Migrate(ctx, store, legacySubspace, cdc))

var res types.Params
bz := store.Get(v2.ParamsKey)
bz := store.Get(types.ParamsKey)
require.NoError(t, cdc.Unmarshal(bz, &res))
require.Equal(t, legacySubspace.ps, res)
}

0 comments on commit 7cc6ce3

Please sign in to comment.