-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add migration function for DeliverTxHookWasmGasLimitParam
- Loading branch information
1 parent
58544eb
commit 426c5b3
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package migrations | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/sei-protocol/sei-chain/x/evm/keeper" | ||
"github.com/sei-protocol/sei-chain/x/evm/types" | ||
) | ||
|
||
func MigrateDeliverTxHookWasmGasLimitParam(ctx sdk.Context, k *keeper.Keeper) error { | ||
defaultParams := types.DefaultParams() | ||
defaultDeliverTxHookWasmGasLimit := defaultParams.DeliverTxHookWasmGasLimit | ||
defaultParams.DeliverTxHookWasmGasLimit = defaultDeliverTxHookWasmGasLimit | ||
k.SetParams(ctx, defaultParams) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package migrations_test | ||
|
||
import ( | ||
"testing" | ||
|
||
testkeeper "github.com/sei-protocol/sei-chain/testutil/keeper" | ||
"github.com/sei-protocol/sei-chain/x/evm/migrations" | ||
"github.com/sei-protocol/sei-chain/x/evm/types" | ||
"github.com/stretchr/testify/require" | ||
tmtypes "github.com/tendermint/tendermint/proto/tendermint/types" | ||
) | ||
|
||
func TestMigrateDeliverTxHookWasmGasLimitParam(t *testing.T) { | ||
k := testkeeper.EVMTestApp.EvmKeeper | ||
ctx := testkeeper.EVMTestApp.NewContext(false, tmtypes.Header{}) | ||
|
||
err := migrations.MigrateDeliverTxHookWasmGasLimitParam(ctx, &k) | ||
|
||
require.NoError(t, err) | ||
|
||
require.NotPanics(t, func() { k.GetParams(ctx) }) | ||
|
||
keeperParams := k.GetParams(ctx) | ||
|
||
require.Equal(t, keeperParams.GetDeliverTxHookWasmGasLimit(), types.DefaultParams().DeliverTxHookWasmGasLimit) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters