Skip to content

Commit

Permalink
chore(tests) refactor to use fundAcc func from testutils (evmos#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
GAtom22 authored Feb 17, 2023
1 parent e70e192 commit 5f96cb7
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions x/feemarket/keeper/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down Expand Up @@ -145,7 +144,7 @@ func setupTest(localMinGasPrices string) (*ethsecp256k1.PrivKey, banktypes.MsgSe
Denom: s.denom,
Amount: amount,
}}
err := fundAccount(s.app.BankKeeper, s.ctx, address, initBalance)
err := testutil.FundAccount(s.ctx, s.app.BankKeeper, address, initBalance)
s.Require().NoError(err)

msg := banktypes.MsgSend{
Expand All @@ -160,16 +159,6 @@ func setupTest(localMinGasPrices string) (*ethsecp256k1.PrivKey, banktypes.MsgSe
return privKey, msg
}

// fundAccount is a utility function that funds an account by minting and
// sending the coins to the address.
func fundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error {
if err := bankKeeper.MintCoins(ctx, evmtypes.ModuleName, amounts); err != nil {
return err
}

return bankKeeper.SendCoinsFromModuleToAccount(ctx, evmtypes.ModuleName, addr, amounts)
}

func setupChain(localMinGasPricesStr string) {
// Initialize the app, so we can use SetMinGasPrices to set the
// validator-specific min-gas-prices setting
Expand Down

0 comments on commit 5f96cb7

Please sign in to comment.