testutil

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewInternalEVMAddressFromString

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

func (suite *Suite) Commit()

func (*Suite) DeployERC20

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

func (*Suite) EventsContains

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

EventsContains asserts that the expected event is in the provided events

func (*Suite) EventsDoNotContain

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

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

func (*Suite) FundAccountWithAether

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

func (*Suite) FundModuleAccountWithAether

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

func (*Suite) GetERC20BalanceOf

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

func (*Suite) GetEvents

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

GetEvents returns emitted events on the sdk context

func (*Suite) MintFeeCollector

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

func (*Suite) QueryContract

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

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