testutils

package
v1.19.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthClientWrapper

type EthClientWrapper struct {
	*ethclient.Client
}

EthClientWrapper wraps *ethclient.Client to implement the ExecutionClient interface

func NewEthClientWrapper

func NewEthClientWrapper(client *ethclient.Client) *EthClientWrapper

NewEthClientWrapper creates a new wrapper around an ethclient.Client

func (*EthClientWrapper) BalanceAt

func (w *EthClientWrapper) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

BalanceAt returns the wei balance of the given account

func (*EthClientWrapper) BlockNumber

func (w *EthClientWrapper) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the most recent block number

func (*EthClientWrapper) CallContract

func (w *EthClientWrapper) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

CallContract executes an Ethereum contract call

func (*EthClientWrapper) ChainID

func (w *EthClientWrapper) ChainID(ctx context.Context) (*big.Int, error)

ChainID retrieves the current chain ID

func (*EthClientWrapper) CodeAt

func (w *EthClientWrapper) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

CodeAt returns the code of the given account

func (*EthClientWrapper) EstimateGas

func (w *EthClientWrapper) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)

EstimateGas tries to estimate the gas needed to execute a specific transaction

func (*EthClientWrapper) FilterLogs

func (w *EthClientWrapper) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

FilterLogs executes a log filter operation

func (*EthClientWrapper) HeaderByHash

func (w *EthClientWrapper) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

HeaderByHash returns the block header with the given hash

func (*EthClientWrapper) HeaderByNumber

func (w *EthClientWrapper) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

HeaderByNumber returns a block header from the current canonical chain

func (*EthClientWrapper) LatestBlockTime

func (w *EthClientWrapper) LatestBlockTime(ctx context.Context) (time.Time, error)

LatestBlockTime returns the timestamp of the latest block

func (*EthClientWrapper) NonceAt

func (w *EthClientWrapper) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

NonceAt returns the account nonce of the given account

func (*EthClientWrapper) PendingCodeAt

func (w *EthClientWrapper) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

PendingCodeAt returns the code of the given account in the pending state

func (*EthClientWrapper) PendingNonceAt

func (w *EthClientWrapper) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

PendingNonceAt retrieves the current pending nonce associated with an account

func (*EthClientWrapper) SendTransaction

func (w *EthClientWrapper) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction injects the transaction into the pending pool for execution

func (*EthClientWrapper) SubscribeFilterLogs

func (w *EthClientWrapper) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

SubscribeFilterLogs creates a background log filtering operation

func (*EthClientWrapper) SuggestGasPrice

func (w *EthClientWrapper) SuggestGasPrice(ctx context.Context) (*big.Int, error)

SuggestGasPrice retrieves the currently suggested gas price

func (*EthClientWrapper) SuggestGasTipCap

func (w *EthClientWrapper) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

SuggestGasTipCap retrieves the currently suggested 1559 priority fee

func (*EthClientWrapper) SyncProgress

func (w *EthClientWrapper) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)

SyncProgress retrieves the current progress of the sync algorithm

func (*EthClientWrapper) TransactionByHash

func (w *EthClientWrapper) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)

TransactionByHash returns the transaction with the given hash

func (*EthClientWrapper) TransactionReceipt

func (w *EthClientWrapper) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

TransactionReceipt returns the receipt of a transaction by transaction hash

Directories

Path Synopsis
tokens
rpl

Jump to

Keyboard shortcuts

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