diff --git a/app/test_helpers.go b/app/test_helpers.go index d5963f93..dd68ea14 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -3,10 +3,11 @@ package app import ( "encoding/json" "fmt" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "testing" "time" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/client" @@ -111,7 +112,7 @@ func SetupApp(t *testing.T) *MigalooApp { Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), } - app := SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, "", balance) + app := SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, "", nil, balance) return app } @@ -120,10 +121,10 @@ func SetupApp(t *testing.T) *MigalooApp { // that also act as delegators. For simplicity, each validator is bonded with a delegation // of one consensus engine unit in the default token of the app from first genesis // account. A Nop logger is set in app. -func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, balances ...banktypes.Balance) *MigalooApp { +func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasmkeeper.Option, balances ...banktypes.Balance) *MigalooApp { t.Helper() - migalooApp, genesisState := setup(true, chainID) + migalooApp, genesisState := setup(true, chainID, opts...) genesisState = genesisStateWithValSet(t, migalooApp, genesisState, valSet, genAccs, balances...) consensusParams := simtestutil.DefaultConsensusParams diff --git a/tests/e2e/gov_test.go b/tests/e2e/gov_test.go index 25a4bb2f..e340d381 100644 --- a/tests/e2e/gov_test.go +++ b/tests/e2e/gov_test.go @@ -1,10 +1,11 @@ package e2e_test import ( - "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/tests/e2e" "testing" "time" + "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/tests/e2e" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tests/e2e/grants_test.go b/tests/e2e/grants_test.go index c13e3c9b..083dce24 100644 --- a/tests/e2e/grants_test.go +++ b/tests/e2e/grants_test.go @@ -180,7 +180,8 @@ func TestStoreCodeGrant(t *testing.T) { for name, spec := range specs { t.Run(name, func(t *testing.T) { // setup grant - grant, err := types.NewCodeGrant(spec.codeHash, &spec.instantiatePermission) + tmp := spec + grant, err := types.NewCodeGrant(tmp.codeHash, &tmp.instantiatePermission) require.NoError(t, err) authorization := types.NewStoreCodeAuthorization(*grant) expiry := time.Now().Add(time.Hour) diff --git a/tests/e2e/helper.go b/tests/e2e/helper.go index 67bed570..e9a9b3ef 100644 --- a/tests/e2e/helper.go +++ b/tests/e2e/helper.go @@ -1,17 +1,18 @@ package e2e import ( + "testing" + wasmibctesting "github.com/CosmWasm/wasmd/x/wasm/ibctesting" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" "github.com/White-Whale-Defi-Platform/migaloo-chain/v4/app" tmtypes "github.com/cometbft/cometbft/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "testing" ) // DefaultMigalooAppFactory instantiates and sets up the default Migaloo app func DefaultMigalooAppFactory(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasmkeeper.Option, balances ...banktypes.Balance) wasmibctesting.ChainApp { t.Helper() - return app.SetupWithGenesisValSet(t, valSet, genAccs, chainID, balances...) + return app.SetupWithGenesisValSet(t, valSet, genAccs, chainID, opts, balances...) }