testutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastTxBytes

func BroadcastTxBytes(app *app.App, txEncoder sdk.TxEncoder, tx sdk.Tx) (abci.ResponseDeliverTx, error)

BroadcastTxBytes encodes a transaction and calls DeliverTx on the app.

func CheckEthTxResponse

func CheckEthTxResponse(r abci.ResponseDeliverTx, cdc codec.Codec) (*evm.MsgEthereumTxResponse, error)

CheckEthTxResponse checks that the transaction was executed successfully

func CheckNFTExists

func CheckNFTExists(
	ctx sdk.Context,
	appSettlus *app.App,
	priv cryptotypes.PrivKey,
	contract evm.CompiledContract,
	contractAddress common.Address,
	constructorArgs ...interface{},
) (bool, error)

func Commit

func Commit(ctx sdk.Context, app *app.App, t time.Duration, vs *tmtypes.ValidatorSet) (sdk.Context, error)

Commit commits a block at a given time. Reminder: At the end of each Tendermint Consensus round the following methods are run

  1. BeginBlock
  2. DeliverTx
  3. EndBlock
  4. Commit

func DeliverEthTx

func DeliverEthTx(
	appSettlus *app.App,
	priv cryptotypes.PrivKey,
	msgs ...sdk.Msg,
) (abci.ResponseDeliverTx, error)

DeliverEthTx generates and broadcasts a Cosmos Tx populated with MsgEthereumTx messages. If a private key is provided, it will attempt to sign all messages with the given private key, otherwise, it will assume the messages have already been signed.

func DeployContract

func DeployContract(
	ctx sdk.Context,
	appSettlus *app.App,
	priv cryptotypes.PrivKey,
	queryClientEvm evm.QueryClient,
	contract evm.CompiledContract,
	constructorArgs ...interface{},
) (common.Address, error)

DeployContract deploys a contract with the provided private key, compiled contract data and constructor arguments

func FundAccount

func FundAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amounts sdk.Coins) error

FundAccount is a utility function that funds an account by minting and sending the coins to the address.

func FundModuleAccount

func FundModuleAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, recipientMod string, amounts sdk.Coins) error

FundModuleAccount is a utility function that funds a module account by minting and sending the coins to the address.

func MintNFT

func MintNFT(
	ctx sdk.Context,
	appSettlus *app.App,
	priv cryptotypes.PrivKey,
	contract evm.CompiledContract,
	contractAddress common.Address,
	constructorArgs ...interface{},
) error

func NewHeader

func NewHeader(
	height int64,
	blockTime time.Time,
	chainID string,
	proposer sdk.ConsAddress,
	appHash,
	validatorHash []byte,
) tmproto.Header

NewHeader creates a new Tendermint header for testing purposes.

func NewMicroUSDC

func NewMicroUSDC(amt int64) sdk.Coin

func NewSetl

func NewSetl(amt int64) sdk.Coin

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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