testutil

package
v0.0.0-...-8cb8a38 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MinWETHWithdrawAmount  = sdk.NewInt(10_000_000_000_000_000)
	MinWFuryWithdrawAmount = sdk.NewInt(2_000_000)
	MinUSDCWithdrawAmount  = sdk.NewInt(10_000_000)
)

Functions

func MustNewExternalEVMAddressFromString

func MustNewExternalEVMAddressFromString(addrStr string) types.ExternalEVMAddress

MustNewExternalEVMAddressFromString returns a new ExternalEVMAddress from a hex string. This will panic if the input hex string is invalid.

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

	Ctx            sdk.Context
	App            app.TestApp
	Address        common.Address
	Key1           *ethsecp256k1.PrivKey
	Key1Addr       types.InternalEVMAddress
	Key2           *ethsecp256k1.PrivKey
	ConsAddress    sdk.ConsAddress
	RelayerAddress sdk.AccAddress
	RelayerKey     *ethsecp256k1.PrivKey

	QueryClientEvm    evmtypes.QueryClient
	QueryClientBridge types.QueryClient

	BankKeeper bankkeeper.Keeper
	Keeper     keeper.Keeper
}

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) 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()

func (*Suite) TestDeployERC20

func (suite *Suite) TestDeployERC20()

Jump to

Keyboard shortcuts

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