monitored

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MonitoredTransactor

type MonitoredTransactor struct {
	// contains filtered or unexported fields
}

func NewMonitoredTransactor

func NewMonitoredTransactor(
	txFabric calls.TxFabric,
	gasPriceClient calls.GasPricer,
	client calls.ClientDispatcher,
	maxGasPrice *big.Int,
	increasePercentage *big.Int,
) *MonitoredTransactor

NewMonitoredTransactor creates an instance of a transactor that periodically checks sent transactions and resends them with higher gas if they are stuck.

Gas price is increased by increasePercentage param which is a percentage value with which old gas price should be increased (e.g 15)

func (*MonitoredTransactor) IncreaseGas

func (t *MonitoredTransactor) IncreaseGas(oldGp []*big.Int) []*big.Int

increase gas bumps gas price by preset percentage.

If gas was 10 and the increaseFactor is 15 the new gas price would be 11 (it floors the value). In case the gas price didn't change it increases it by 1.

func (*MonitoredTransactor) Monitor

func (t *MonitoredTransactor) Monitor(
	ctx context.Context,
	resendInterval time.Duration,
	txTimeout time.Duration,
	tooNewTransaction time.Duration,
)

func (*MonitoredTransactor) Transact

func (t *MonitoredTransactor) Transact(to *common.Address, data []byte, opts transactor.TransactOptions) (*common.Hash, error)

type RawTx

type RawTx struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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