Skip to content

Commit

Permalink
Pass paramstore by reference to migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrit committed Aug 17, 2023
1 parent 22b247b commit 0cf501b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion module/x/gravity/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error {

// Migrate2to3 migrates from consensus version 2 to 3.
func (m Migrator) Migrate2to3(ctx sdk.Context) error {
return v2.MigrateParamStore(ctx, m.keeper.paramSpace)
return v2.MigrateParamStore(ctx, &m.keeper.paramSpace)
}
2 changes: 1 addition & 1 deletion module/x/gravity/migrations/v2/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/peggyjv/gravity-bridge/module/v3/x/gravity/types"
)

func MigrateParamStore(ctx sdktypes.Context, subspace paramstypes.Subspace) error {
func MigrateParamStore(ctx sdktypes.Context, subspace *paramstypes.Subspace) error {
if subspace.HasKeyTable() {
subspace.Set(ctx, types.ParamStoreConfirmedOutgoingTxWindow, types.DefaultParams().ConfirmedOutgoingTxWindow)
subspace.Set(ctx, types.ParamStoreEventVoteWindow, types.DefaultParams().EthereumEventVoteWindow)
Expand Down
2 changes: 1 addition & 1 deletion module/x/gravity/migrations/v2/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestStoreMigration(t *testing.T) {
require.False(t, paramstore.Has(ctx, types.ParamStoreEventVoteWindow))

// Run migrations.
err := v2.MigrateParamStore(ctx, paramstore)
err := v2.MigrateParamStore(ctx, &paramstore)
require.NoError(t, err)

// Make sure the new params are set.
Expand Down

0 comments on commit 0cf501b

Please sign in to comment.