Documentation ¶
Index ¶
- Variables
- func Call(ctx sdk.Context, app *haqqapp.Haqq, args CallArgs) (res abci.ResponseDeliverTx, ethRes *evmtypes.MsgEthereumTxResponse, err error)
- func CallContractAndCheckLogs(ctx sdk.Context, app *haqqapp.Haqq, cArgs CallArgs, ...) (abci.ResponseDeliverTx, *evmtypes.MsgEthereumTxResponse, error)
- type CallArgs
- func (c CallArgs) WithABI(abi abi.ABI) CallArgs
- func (c CallArgs) WithAccessList(accessList *ethtypes.AccessList) CallArgs
- func (c CallArgs) WithAddress(addr common.Address) CallArgs
- func (c CallArgs) WithAmount(amount *big.Int) CallArgs
- func (c CallArgs) WithArgs(args ...interface{}) CallArgs
- func (c CallArgs) WithGasFeeCap(gasFeeCap *big.Int) CallArgs
- func (c CallArgs) WithGasLimit(gasLimit uint64) CallArgs
- func (c CallArgs) WithGasPrice(gasPrice *big.Int) CallArgs
- func (c CallArgs) WithGasTipCap(gasTipCap *big.Int) CallArgs
- func (c CallArgs) WithMethodName(methodName string) CallArgs
- func (c CallArgs) WithNonce(nonce *big.Int) CallArgs
- func (c CallArgs) WithPrivKey(privKey *ethsecp256k1.PrivKey) CallArgs
Constants ¶
This section is empty.
Variables ¶
var ( //go:embed DistributionCaller.json DistributionCallerJSON []byte // DistributionCallerContract is the compiled contract calling the distribution precompile DistributionCallerContract evmtypes.CompiledContract )
var ( //go:embed InterchainSender.json InterchainSenderJSON []byte // InterchainSenderContract is the compiled contract calling the distribution precompile InterchainSenderContract evmtypes.CompiledContract )
Functions ¶
func Call ¶
func Call(ctx sdk.Context, app *haqqapp.Haqq, args CallArgs) (res abci.ResponseDeliverTx, ethRes *evmtypes.MsgEthereumTxResponse, err error)
Call is a helper function to call any arbitrary smart contract.
func CallContractAndCheckLogs ¶
func CallContractAndCheckLogs(ctx sdk.Context, app *haqqapp.Haqq, cArgs CallArgs, logCheckArgs testutil.LogCheckArgs) (abci.ResponseDeliverTx, *evmtypes.MsgEthereumTxResponse, error)
CallContractAndCheckLogs is a helper function to call any arbitrary smart contract and check that the logs contain the expected events.
Types ¶
type CallArgs ¶
type CallArgs struct { // Amount is the msg.value sent with the transaction. Amount *big.Int // AccessList is the access list to use for the transaction. If not empty, the transaction will be an EIP-2930 transaction (AccessListTx). AccessList *ethtypes.AccessList // ContractAddr is the address of the contract to call. ContractAddr common.Address // ContractABI is the ABI of the contract to call. ContractABI abi.ABI // MethodName is the name of the method to call. MethodName string // Nonce is the nonce to use for the transaction. Nonce *big.Int // GasLimit to use for the transaction GasLimit uint64 // GasPrice is the gas price to use. If left empty, the base fee for the current block will be used. GasPrice *big.Int // GasFeeCap is the gas fee cap to use. If not empty, the transaction will be an EIP-1559 transaction (DynamicFeeTx). GasFeeCap *big.Int // GasTipCap is the gas tip cap to use. If not empty, the transaction will be an EIP-1559 transaction (DynamicFeeTx). GasTipCap *big.Int // PrivKey is the private key to be used for the transaction. PrivKey cryptotypes.PrivKey // Args are the arguments to pass to the method. Args []interface{} }
CallArgs is a struct to define all relevant data to call a smart contract.
func (CallArgs) WithAccessList ¶
func (c CallArgs) WithAccessList(accessList *ethtypes.AccessList) CallArgs
WithAccessList returns the CallArgs with the given access list.
func (CallArgs) WithAddress ¶
WithAddress returns the CallArgs with the given address.
func (CallArgs) WithAmount ¶
WithAmount populates the CallArgs struct's Amount field with the given amount. This is the amount of ISLM that will be sent with the contract call.
func (CallArgs) WithArgs ¶
WithArgs populates the CallArgs struct's Args field with the given list of arguments. These are the arguments that will be packed into the contract call input.
func (CallArgs) WithGasFeeCap ¶
WithGasFeeCap returns the CallArgs with the given gas fee cap.
func (CallArgs) WithGasLimit ¶
WithGasLimit returns the CallArgs with the given gas limit.
func (CallArgs) WithGasPrice ¶
WithGasPrice returns the CallArgs with the given gas price.
func (CallArgs) WithGasTipCap ¶
WithGasTipCap returns the CallArgs with the given gas tip cap.
func (CallArgs) WithMethodName ¶
WithMethodName returns the CallArgs with the given method name.
func (CallArgs) WithPrivKey ¶
func (c CallArgs) WithPrivKey(privKey *ethsecp256k1.PrivKey) CallArgs
WithPrivKey returns the CallArgs with the given private key.