Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Mar 26, 2024
1 parent c3d36e8 commit 87f2652
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
9 changes: 5 additions & 4 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/gov_test.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/grants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e/helper.go
Original file line number Diff line number Diff line change
@@ -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...)
}

0 comments on commit 87f2652

Please sign in to comment.