testutil

package
v0.19.1-testnet Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewInternalEVMAddressFromString added in v0.19.0

func MustNewInternalEVMAddressFromString(addrStr string) types.InternalEVMAddress

MustNewInternalEVMAddressFromString returns a new InternalEVMAddress from a hex string. This will panic if the input hex string is invalid.

Types

type Suite

type Suite struct {
	suite.Suite

	App            app.TestApp
	Ctx            sdk.Context
	Address        common.Address
	BankKeeper     bankkeeper.Keeper
	AccountKeeper  authkeeper.AccountKeeper
	Keeper         keeper.Keeper
	EvmBankKeeper  keeper.EvmBankKeeper
	Addrs          []sdk.AccAddress
	EvmModuleAddr  sdk.AccAddress
	QueryClient    types.QueryClient
	QueryClientEvm evmtypes.QueryClient
	Key1           *ethsecp256k1.PrivKey
	Key1Addr       types.InternalEVMAddress
	Key2           *ethsecp256k1.PrivKey
}

func (*Suite) Commit added in v0.19.0

func (suite *Suite) Commit()

func (*Suite) DeployERC20 added in v0.19.0

func (suite *Suite) DeployERC20() types.InternalEVMAddress

func (*Suite) EventsContains added in v0.19.0

func (suite *Suite) EventsContains(events sdk.Events, expectedEvent sdk.Event)

EventsContains asserts that the expected event is in the provided events

func (*Suite) EventsDoNotContain added in v0.19.0

func (suite *Suite) EventsDoNotContain(events sdk.Events, eventType string)

EventsDoNotContain asserts that the event is **not** is in the provided events

func (*Suite) FundAccountWithKava

func (suite *Suite) FundAccountWithKava(addr sdk.AccAddress, coins sdk.Coins)

func (*Suite) FundModuleAccountWithKava

func (suite *Suite) FundModuleAccountWithKava(moduleName string, coins sdk.Coins)

func (*Suite) GetERC20BalanceOf added in v0.19.0

func (suite *Suite) GetERC20BalanceOf(
	contractAbi abi.ABI,
	contractAddr types.InternalEVMAddress,
	accountAddr types.InternalEVMAddress,
) *big.Int

func (*Suite) GetEvents added in v0.19.0

func (suite *Suite) GetEvents() sdk.Events

GetEvents returns emitted events on the sdk context

func (*Suite) MintFeeCollector added in v0.19.0

func (suite *Suite) MintFeeCollector(coins sdk.Coins)

func (*Suite) QueryContract added in v0.19.0

func (suite *Suite) QueryContract(
	contractAbi abi.ABI,
	from common.Address,
	fromKey *ethsecp256k1.PrivKey,
	contract types.InternalEVMAddress,
	method string,
	args ...interface{},
) ([]interface{}, error)

func (*Suite) SendTx added in v0.19.0

func (suite *Suite) SendTx(
	contractAddr types.InternalEVMAddress,
	from common.Address,
	signerKey *ethsecp256k1.PrivKey,
	transferData []byte,
) (*evmtypes.MsgEthereumTxResponse, error)

SendTx submits a transaction to the block.

func (*Suite) SetupTest

func (suite *Suite) SetupTest()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL