types

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultGasCap is the default gas cap for eth_call
	DefaultGasCap uint64 = 25000000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompiledContract

type CompiledContract struct {
	ABI abi.ABI
	Bin HexString
}

CompiledContract contains compiled bytecode and abi

type EthCallRequest

type EthCallRequest struct {
	// args uses the same json format as the json rpc api.
	Args []byte `json:"args,omitempty"`
	// gas_cap defines the default gas cap to be used
	GasCap uint64 `json:"gas_cap,omitempty"`
	// proposer_address of the requested block in hex format
	ProposerAddress sdk.ConsAddress `json:"proposer_address,omitempty"`
	// chain_id is the eip155 chain id parsed from the requested block header
	ChainID int64 `json:"chain_id,omitempty"`
}

EthCallRequest represents the arguments to the eth_call RPC

type HexString

type HexString []byte

HexString is a byte array that serializes to hex

func (HexString) MarshalJSON

func (s HexString) MarshalJSON() ([]byte, error)

MarshalJSON serializes ByteArray to hex

func (*HexString) UnmarshalJSON

func (s *HexString) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes ByteArray to hex

type NoOpTracer

type NoOpTracer struct{}

NoOpTracer is an empty implementation of vm.Tracer interface

func NewNoOpTracer

func NewNoOpTracer() *NoOpTracer

NewNoOpTracer creates a no-op vm.Tracer

func (NoOpTracer) CaptureEnd

func (dt NoOpTracer) CaptureEnd(output []byte, gasUsed uint64, tm time.Duration, err error)

CaptureEnd implements vm.Tracer interface

func (NoOpTracer) CaptureEnter

func (dt NoOpTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int)

CaptureEnter implements vm.Tracer interface

func (NoOpTracer) CaptureExit

func (dt NoOpTracer) CaptureExit(output []byte, gasUsed uint64, err error)

CaptureExit implements vm.Tracer interface

func (NoOpTracer) CaptureFault

func (dt NoOpTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error)

CaptureFault implements vm.Tracer interface

func (NoOpTracer) CaptureStart

func (dt NoOpTracer) CaptureStart(env *vm.EVM,
	from common.Address,
	to common.Address,
	create bool,
	input []byte,
	gas uint64,
	value *big.Int)

CaptureStart implements vm.Tracer interface

func (NoOpTracer) CaptureState

func (dt NoOpTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error)

CaptureState implements vm.Tracer interface

func (NoOpTracer) CaptureTxEnd

func (dt NoOpTracer) CaptureTxEnd(restGas uint64)

CaptureTxEnd implements vm.Tracer interface

func (NoOpTracer) CaptureTxStart

func (dt NoOpTracer) CaptureTxStart(gasLimit uint64)

CaptureTxStart implements vm.Tracer interface

type Result

type Result struct {
	// hash of the ethereum transaction in hex format. This hash differs from the
	// Tendermint sha256 hash of the transaction bytes. See
	// https://github.com/tendermint/tendermint/issues/6539 for reference
	Hash string
	// logs contains the transaction hash and the proto-compatible ethereum
	// logs.
	Logs []*ethtypes.Log
	// ret is the returned data from evm function (result or data supplied with revert
	// opcode)
	Ret []byte
	// vm_error is the error returned by vm execution
	VMError string
	// gas_used specifies how much gas was consumed by the transaction
	GasUsed uint64
}

Result represents the result of a contract execution

func (*Result) Failed

func (r *Result) Failed() bool

Failed returns if the contract execution failed in vm errors

func (*Result) Return

func (r *Result) Return() []byte

Return is a helper function to help caller distinguish between revert reason and function return. Return returns the data after execution if no error occurs.

func (*Result) Revert

func (r *Result) Revert() []byte

Revert returns the concrete revert reason if the execution is aborted by `REVERT` opcode. Note the reason can be nil if no data supplied with revert opcode.

type TransactionArgs

type TransactionArgs struct {
	From                 *common.Address `json:"from"`
	To                   *common.Address `json:"to"`
	Gas                  *hexutil.Uint64 `json:"gas"`
	GasPrice             *hexutil.Big    `json:"gasPrice"`
	MaxFeePerGas         *hexutil.Big    `json:"maxFeePerGas"`
	MaxPriorityFeePerGas *hexutil.Big    `json:"maxPriorityFeePerGas"`
	Value                *hexutil.Big    `json:"value"`
	Nonce                *hexutil.Uint64 `json:"nonce"`

	// We accept "data" and "input" for backwards-compatibility reasons.
	// "input" is the newer name and should be preferred by clients.
	Data  *hexutil.Bytes `json:"data"`
	Input *hexutil.Bytes `json:"input"`

	// Introduced by AccessListTxType transaction.
	AccessList *ethtypes.AccessList `json:"accessList,omitempty"`
	ChainID    *hexutil.Big         `json:"chainId,omitempty"`
}

TransactionArgs represents the arguments to construct a new transaction or a message call using JSON-RPC.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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