integration

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			cmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default CometBFT consensus params used in Cosmos EVM testing.

Functions

func BroadcastTxBytes

func BroadcastTxBytes(app evm.EvmApp, txEncoder sdk.TxEncoder, tx sdk.Tx) (abci.ExecTxResult, error)

BroadcastTxBytes encodes a transaction and calls DeliverTx on the app.

func CheckEthTxResponse

func CheckEthTxResponse(r abci.ExecTxResult, cdc codec.Codec) ([]*evmtypes.MsgEthereumTxResponse, error)

CheckEthTxResponse checks that the transaction was executed successfully

func DeliverEthTx

func DeliverEthTx(
	evmApp evm.EvmApp,
	priv cryptotypes.PrivKey,
	msgs ...sdk.Msg,
) (abci.ExecTxResult, 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,
	app evm.EvmApp,
	priv cryptotypes.PrivKey,
	queryClientEvm evmtypes.QueryClient,
	contract evmtypes.CompiledContract,
	constructorArgs ...interface{},
) (common.Address, error)

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

func DeployContractWithFactory

func DeployContractWithFactory(
	ctx sdk.Context,
	exampleApp evm.EvmApp,
	priv cryptotypes.PrivKey,
	factoryAddress common.Address,
) (common.Address, abci.ExecTxResult, error)

DeployContractWithFactory deploys a contract using a contract factory with the provided factoryAddress

Types

type ContractArgs

type ContractArgs struct {
	// Addr is the address of the contract to call.
	Addr common.Address
	// ABI is the ABI of the contract to call.
	ABI abi.ABI
	// MethodName is the name of the method to call.
	MethodName string
	// Args are the arguments to pass to the method.
	Args []interface{}
}

ContractArgs are the params used for calling a smart contract.

type ContractCallArgs

type ContractCallArgs struct {
	// Contract are the contract-specific arguments required for the contract call.
	Contract ContractArgs
	// Nonce is the nonce to use for the transaction.
	Nonce *big.Int
	// Amount is the amount of the native denomination to send in the transaction.
	Amount *big.Int
	// GasLimit to use for the transaction
	GasLimit uint64
	// PrivKey is the private key to be used for the transaction.
	PrivKey cryptotypes.PrivKey
}

ContractCallArgs is the arguments for calling a smart contract.

Directories

Path Synopsis
base
evm

Jump to

Keyboard shortcuts

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