WIP: fixing the test cases

This commit is contained in:
Sai Kumar
2022-04-26 16:09:18 +05:30
parent e8b0e2cf30
commit 694d4c667d
26 changed files with 351 additions and 199 deletions
+3 -3
View File
@@ -4,8 +4,8 @@ import (
"context"
"fmt"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
"github.com/tharsis/ethermint/app"
"github.com/tharsis/ethermint/x/auction/types"
)
@@ -40,7 +40,7 @@ func (suite *KeeperTestSuite) TestGrpcGetAllAuctions() {
suite.Run(fmt.Sprintf("Case %s", test.msg), func() {
if test.createAuctions {
account := app.CreateRandomAccounts(1)[0]
err := simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(
sdk.Coin{Amount: sdk.NewInt(100), Denom: sdk.DefaultBondDenom},
))
@@ -329,7 +329,7 @@ func (suite *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.
accounts := app.CreateRandomAccounts(accCount)
for _, account := range accounts {
err := simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(
sdk.Coin{Amount: sdk.NewInt(100), Denom: sdk.DefaultBondDenom},
))
if err != nil {
+2 -2
View File
@@ -22,7 +22,7 @@ type KeeperTestSuite struct {
}
func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(suite.T(), false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
}
func TestParams(t *testing.T) {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(t, false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
+6 -5
View File
@@ -3,8 +3,9 @@ package keeper_test
import (
"context"
"fmt"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
"github.com/tharsis/ethermint/app"
"github.com/tharsis/ethermint/x/bond/types"
)
@@ -39,7 +40,7 @@ func (suite *KeeperTestSuite) TestGrpcQueryBondsList() {
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
if test.createBonds {
account := app.CreateRandomAccounts(1)[0]
err := simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
Denom: sdk.DefaultBondDenom,
Amount: sdk.NewInt(1000),
}))
@@ -102,7 +103,7 @@ func (suite *KeeperTestSuite) TestGrpcQueryBondBondId() {
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
if test.createBonds {
account := app.CreateRandomAccounts(1)[0]
err := simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
err := testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
Denom: sdk.DefaultBondDenom,
Amount: sdk.NewInt(1000),
}))
@@ -156,7 +157,7 @@ func (suite *KeeperTestSuite) TestGrpcGetBondsByOwner() {
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
if test.createBonds {
account := app.CreateRandomAccounts(1)[0]
_ = simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
_ = testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
Denom: sdk.DefaultBondDenom,
Amount: sdk.NewInt(1000),
}))
@@ -200,7 +201,7 @@ func (suite *KeeperTestSuite) TestGrpcGetModuleBalance() {
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
if test.createBonds {
account := app.CreateRandomAccounts(1)[0]
_ = simapp.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
_ = testutil.FundAccount(suite.app.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
Denom: sdk.DefaultBondDenom,
Amount: sdk.NewInt(1000),
}))
+2 -2
View File
@@ -22,7 +22,7 @@ type KeeperTestSuite struct {
}
func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(suite.T(), false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
}
func TestParams(t *testing.T) {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(t, false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
+1 -7
View File
@@ -5,23 +5,17 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/stretchr/testify/require"
abcitypes "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
app "github.com/tharsis/ethermint/app"
bondtypes "github.com/tharsis/ethermint/x/bond/types"
)
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
app := app.Setup(t, false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
app.InitChain(abcitypes.RequestInitChain{
AppStateBytes: []byte("{}"),
ChainId: "test-chain-id",
})
acc := app.AccountKeeper.GetModuleAccount(ctx, bondtypes.ModuleName)
require.NotNil(t, acc)
}
+18 -36
View File
@@ -8,12 +8,9 @@ import (
"github.com/gogo/protobuf/proto"
abci "github.com/tendermint/tendermint/abci/types"
tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/cosmos/cosmos-sdk/simapp"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
@@ -75,7 +72,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
require.NoError(t, err)
consAddress := sdk.ConsAddress(priv.PubKey().Address())
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
suite.app = app.Setup(suite.T(), checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
if suite.dynamicTxFee {
feemarketGenesis := feemarkettypes.DefaultGenesisState()
feemarketGenesis.Params.EnableHeight = 1
@@ -85,36 +82,6 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
return genesis
})
coins := sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdk.NewInt(100000000000000)))
genesisState := app.ModuleBasics.DefaultGenesis(suite.app.AppCodec())
b32address := sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), priv.PubKey().Address().Bytes())
balances := []banktypes.Balance{
{
Address: b32address,
Coins: coins,
},
{
Address: suite.app.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName).String(),
Coins: coins,
},
}
// update total supply
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdk.NewInt(200000000000000))), []banktypes.Metadata{})
genesisState[banktypes.ModuleName] = suite.app.AppCodec().MustMarshalJSON(bankGenesis)
stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ")
require.NoError(t, err)
// Initialize the chain
suite.app.InitChain(
abci.RequestInitChain{
ChainId: "ethermint_9000-1",
Validators: []abci.ValidatorUpdate{},
ConsensusParams: simapp.DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1,
ChainID: "ethermint_9000-1",
@@ -139,10 +106,25 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
LastResultsHash: tmhash.Sum([]byte("last_result")),
})
coins := sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdk.NewInt(100000000000000)))
b32address := sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), priv.PubKey().Address().Bytes())
accAddr, err := sdk.AccAddressFromBech32(b32address)
require.NoError(t, err)
acc := &ethermint.EthAccount{
BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(accAddr.Bytes()), nil, 0, 0),
CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(),
}
err = testutil.FundAccount(suite.app.BankKeeper, suite.ctx, accAddr, coins)
require.NoError(t, err)
err = testutil.FundModuleAccount(suite.app.BankKeeper, suite.ctx, authtypes.FeeCollectorName, coins)
require.NoError(t, err)
queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry())
types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper)
acc := &ethermint.EthAccount{
acc = &ethermint.EthAccount{
BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(address.Bytes()), nil, 0, 0),
CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(),
}
+2 -1
View File
@@ -14,6 +14,7 @@ import (
ethtypes "github.com/ethereum/go-ethereum/core/types"
ethermint "github.com/tharsis/ethermint/types"
"github.com/tharsis/ethermint/x/evm/types"
authmiddleware "github.com/cosmos/cosmos-sdk/x/auth/middleware"
)
func SetupContract(b *testing.B) (*KeeperTestSuite, common.Address) {
@@ -135,7 +136,7 @@ func BenchmarkMessageCall(b *testing.B) {
require.NoError(b, err)
fees := sdk.Coins{sdk.NewCoin(suite.EvmDenom(), sdk.NewIntFromBigInt(txData.Fee()))}
err = authante.DeductFees(suite.app.BankKeeper, suite.ctx, suite.app.AccountKeeper.GetAccount(ctx, msg.GetFrom()), fees)
err = authmiddleware.DeductFees(suite.app.BankKeeper, suite.ctx, suite.app.AccountKeeper.GetAccount(ctx, msg.GetFrom()), fees)
require.NoError(b, err)
rsp, err := suite.app.EvmKeeper.EthereumTx(sdk.WrapSDKContext(ctx), msg)
+1 -1
View File
@@ -467,7 +467,7 @@ func (suite *KeeperTestSuite) TestQueryValidatorAccount() {
for _, tc := range testCases {
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
suite.SetupTest() // reset
// suite.SetupTest() // reset
tc.malleate()
ctx := sdk.WrapSDKContext(suite.ctx)
+8 -34
View File
@@ -18,9 +18,8 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
tmjson "github.com/tendermint/tendermint/libs/json"
feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types"
"github.com/tharsis/ethermint/app"
@@ -86,7 +85,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) {
require.NoError(t, err)
suite.consAddress = sdk.ConsAddress(priv.PubKey().Address())
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
suite.app = app.Setup(suite.T(), checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
feemarketGenesis := feemarkettypes.DefaultGenesisState()
if suite.enableFeemarket {
feemarketGenesis.Params.EnableHeight = 1
@@ -106,37 +105,6 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) {
return genesis
})
if suite.mintFeeCollector {
// mint some coin to fee collector
coins := sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdk.NewInt(int64(params.TxGas)-1)))
genesisState := app.ModuleBasics.DefaultGenesis(suite.app.AppCodec())
balances := []banktypes.Balance{
{
Address: suite.app.AccountKeeper.GetModuleAddress(authtypes.FeeCollectorName).String(),
Coins: coins,
},
}
// update total supply
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdk.NewInt((int64(params.TxGas)-1)))), []banktypes.Metadata{})
bz := suite.app.AppCodec().MustMarshalJSON(bankGenesis)
require.NotNil(t, bz)
genesisState[banktypes.ModuleName] = suite.app.AppCodec().MustMarshalJSON(bankGenesis)
// we marshal the genesisState of all module to a byte array
stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ")
require.NoError(t, err)
// Initialize the chain
suite.app.InitChain(
abci.RequestInitChain{
ChainId: "ethermint_9000-1",
Validators: []abci.ValidatorUpdate{},
ConsensusParams: simapp.DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)
}
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1,
ChainID: "ethermint_9000-1",
@@ -161,6 +129,12 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) {
LastResultsHash: tmhash.Sum([]byte("last_result")),
})
if suite.mintFeeCollector {
// mint some coin to fee collector
coins := sdk.NewCoins(sdk.NewCoin(types.DefaultEVMDenom, sdk.NewInt(int64(params.TxGas)-1)))
testutil.FundModuleAccount(suite.app.BankKeeper, suite.ctx, authtypes.FeeCollectorName, coins)
}
queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry())
types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper)
suite.queryClient = types.NewQueryClient(queryHelper)
+13 -13
View File
@@ -6,7 +6,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
// authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
authmiddleware "github.com/cosmos/cosmos-sdk/x/auth/middleware"
evmtypes "github.com/tharsis/ethermint/x/evm/types"
@@ -25,10 +25,10 @@ func (k Keeper) DeductTxCostsFromUserBalance(
isContractCreation := txData.GetTo() == nil
// fetch sender account from signature
// signerAcc, err := authante.GetSignerAcc(ctx, k.accountKeeper, msgEthTx.GetFrom())
// if err != nil {
// return nil, sdkerrors.Wrapf(err, "account not found for sender %s", msgEthTx.From)
// }
signerAcc, err := authmiddleware.GetSignerAcc(ctx, k.accountKeeper, msgEthTx.GetFrom())
if err != nil {
return nil, sdkerrors.Wrapf(err, "account not found for sender %s", msgEthTx.From)
}
gasLimit := txData.GetGas()
@@ -74,14 +74,14 @@ func (k Keeper) DeductTxCostsFromUserBalance(
fees := sdk.Coins{sdk.NewCoin(denom, sdk.NewIntFromBigInt(feeAmt))}
// // deduct the full gas cost from the user balance
// if err := authante.DeductFees(k.bankKeeper, ctx, signerAcc, fees); err != nil {
// return nil, sdkerrors.Wrapf(
// err,
// "failed to deduct full gas cost %s from the user %s balance",
// fees, msgEthTx.From,
// )
// }
// deduct the full gas cost from the user balance
if err := authmiddleware.DeductFees(k.bankKeeper, ctx, signerAcc, fees); err != nil {
return nil, sdkerrors.Wrapf(
err,
"failed to deduct full gas cost %s from the user %s balance",
fees, msgEthTx.From,
)
}
return fees, nil
}
+8 -7
View File
@@ -2,8 +2,9 @@ package keeper_test
import (
"fmt"
abci "github.com/tendermint/tendermint/abci/types"
"math/big"
prototypes "github.com/tendermint/tendermint/proto/tendermint/types"
)
func (suite *KeeperTestSuite) TestCalculateBaseFee() {
@@ -38,11 +39,11 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() {
suite.app.FeeMarketKeeper.SetBlockGasUsed(suite.ctx, 100)
// Set target/gasLimit through Consensus Param MaxGas
blockParams := abci.BlockParams{
blockParams := prototypes.BlockParams{
MaxGas: 100,
MaxBytes: 10,
}
consParams := abci.ConsensusParams{Block: &blockParams}
consParams := prototypes.ConsensusParams{Block: &blockParams}
suite.ctx = suite.ctx.WithConsensusParams(&consParams)
// set ElasticityMultiplier
@@ -60,11 +61,11 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() {
suite.app.FeeMarketKeeper.SetBlockGasUsed(suite.ctx, 200)
blockParams := abci.BlockParams{
blockParams := prototypes.BlockParams{
MaxGas: 100,
MaxBytes: 10,
}
consParams := abci.ConsensusParams{Block: &blockParams}
consParams := prototypes.ConsensusParams{Block: &blockParams}
suite.ctx = suite.ctx.WithConsensusParams(&consParams)
params := suite.app.FeeMarketKeeper.GetParams(suite.ctx)
@@ -81,11 +82,11 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() {
suite.app.FeeMarketKeeper.SetBlockGasUsed(suite.ctx, 50)
blockParams := abci.BlockParams{
blockParams := prototypes.BlockParams{
MaxGas: 100,
MaxBytes: 10,
}
consParams := abci.ConsensusParams{Block: &blockParams}
consParams := prototypes.ConsensusParams{Block: &blockParams}
suite.ctx = suite.ctx.WithConsensusParams(&consParams)
params := suite.app.FeeMarketKeeper.GetParams(suite.ctx)
+1 -12
View File
@@ -15,8 +15,6 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/tharsis/ethermint/app"
"github.com/tharsis/ethermint/crypto/ethsecp256k1"
"github.com/tharsis/ethermint/encoding"
@@ -66,7 +64,7 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) {
require.NoError(t, err)
suite.consAddress = sdk.ConsAddress(priv.PubKey().Address())
suite.app = app.Setup(checkTx, nil)
suite.app = app.Setup(suite.T(), checkTx, nil)
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1,
ChainID: "ethermint_9000-1",
@@ -101,15 +99,6 @@ func (suite *KeeperTestSuite) DoSetupTest(t require.TestingT) {
}
suite.app.AccountKeeper.SetAccount(suite.ctx, acc)
valAddr := sdk.ValAddress(suite.address.Bytes())
validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{})
err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator)
require.NoError(t, err)
err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator)
require.NoError(t, err)
suite.app.StakingKeeper.SetValidator(suite.ctx, validator)
encodingConfig := encoding.MakeConfig(app.ModuleBasics)
suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig)
suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
+3 -4
View File
@@ -1,7 +1,6 @@
package v010_test
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
@@ -22,12 +21,12 @@ import (
func TestMigrateStore(t *testing.T) {
encCfg := encoding.MakeConfig(app.ModuleBasics)
feemarketKey := sdk.NewKVStoreKey(feemarkettypes.StoreKey)
tFeeMarketKey := sdk.NewTransientStoreKey(fmt.Sprintf("%s_test", feemarkettypes.StoreKey))
tFeeMarketKey := sdk.NewTransientStoreKey("margetkey_test")
ctx := testutil.DefaultContext(feemarketKey, tFeeMarketKey)
paramstore := paramtypes.NewSubspace(
encCfg.Marshaler, encCfg.Amino, feemarketKey, tFeeMarketKey, "feemarket",
encCfg.Codec, encCfg.Amino, feemarketKey, tFeeMarketKey, "feemarket",
)
fmKeeper := feemarketkeeper.NewKeeper(encCfg.Marshaler, feemarketKey, paramstore)
fmKeeper := feemarketkeeper.NewKeeper(encCfg.Codec, feemarketKey, paramstore)
fmKeeper.SetParams(ctx, types.DefaultParams())
require.True(t, paramstore.HasKeyTable())
+4 -3
View File
@@ -6,6 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
@@ -25,7 +26,7 @@ type KeeperTestSuite struct {
}
func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(suite.T(), false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@@ -38,7 +39,7 @@ func (suite *KeeperTestSuite) SetupTest() {
suite.accounts = app.CreateRandomAccounts(1)
account := suite.accounts[0]
_ = simapp.FundAccount(testApp.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
_ = testutil.FundAccount(testApp.BankKeeper, ctx, account, sdk.NewCoins(sdk.Coin{
Denom: sdk.DefaultBondDenom,
Amount: sdk.NewInt(100000000000),
}))
@@ -52,7 +53,7 @@ func (suite *KeeperTestSuite) SetupTest() {
}
func TestParams(t *testing.T) {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
testApp := app.Setup(t, false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis
})
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})