Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBlockGasLimit ¶
WithBlockGasLimit configures the simulated backend to target a specific gas limit when producing blocks.
func WithCallGasLimit ¶
WithCallGasLimit configures the simulated backend to cap eth_calls to a specific gas limit when running client operations.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a simulated blockchain for testing.
func NewBackend ¶
func NewBackend(alloc types.GenesisAlloc, options ...func(*ethconfig.Config)) *Backend
NewBackend creates a new simulated backend.
func (*Backend) AdjustTime ¶
AdjustTime changes the block timestamp.
type Client ¶
type Client interface {
bind.ContractBackend
Close()
ChainID(context.Context) (*big.Int, error)
BlockByNumber(context.Context, *big.Int) (*types.Block, error)
BlockNumber(context.Context) (uint64, error)
HeaderByHash(context.Context, common.Hash) (*types.Header, error)
HeaderByNumber(context.Context, *big.Int) (*types.Header, error)
TransactionReceipt(context.Context, common.Hash) (*types.Receipt, error)
TransactionByHash(context.Context, common.Hash) (*types.Transaction, bool, error)
BalanceAt(context.Context, common.Address, *big.Int) (*big.Int, error)
NonceAt(context.Context, common.Address, *big.Int) (uint64, error)
SuggestGasPrice(context.Context) (*big.Int, error)
EstimateBaseFee(context.Context) (*big.Int, error)
}
Client exposes the methods provided by the Ethereum RPC client.
Click to show internal directories.
Click to hide internal directories.