transactions

package
v0.0.0-...-9cf06c2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PadGasEstimate

func PadGasEstimate(opts *bind.TransactOpts, paddingFactor float64, builder TxBuilder) (*types.Transaction, error)

PadGasEstimate multiplies the gas estimate for a transaction by the specified paddingFactor before sending the actual transaction. Useful for cases where the gas required is variable. The builder will be invoked twice, first with NoSend=true to estimate the gas and the second time with NoSend=false and GasLimit including the requested padding.

func RequireSendTx

func RequireSendTx(t *testing.T, ctx context.Context, client *ethclient.Client, candidate txmgr.TxCandidate, privKey *ecdsa.PrivateKey, opts ...SendTxOpt)

func SendTx

func SendTx(ctx context.Context, client *ethclient.Client, candidate txmgr.TxCandidate, privKey *ecdsa.PrivateKey, opts ...SendTxOpt) (*types.Transaction, *types.Receipt, error)

Types

type ErrWithData

type ErrWithData interface {
	ErrorData() interface{}
}

type SendTxOpt

type SendTxOpt func(cfg *sendTxCfg)

func WithReceiptFail

func WithReceiptFail() SendTxOpt

type TxBuilder

type TxBuilder func(opts *bind.TransactOpts) (*types.Transaction, error)

TxBuilder creates and sends a transaction using the supplied bind.TransactOpts. Returns the created transaction and any error reported.

Jump to

Keyboard shortcuts

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