txmgr

package
v2.12.1-starknet-06212024 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TransmitCheckerTypeSimulate is a checker that simulates the transaction before executing on
	// chain.
	TransmitCheckerTypeSimulate = txmgrtypes.TransmitCheckerType("simulate")

	// TransmitCheckerTypeVRFV1 is a checker that will not submit VRF V1 fulfillment requests that
	// have already been fulfilled. This could happen if the request was fulfilled by another node.
	TransmitCheckerTypeVRFV1 = txmgrtypes.TransmitCheckerType("vrf_v1")

	// TransmitCheckerTypeVRFV2 is a checker that will not submit VRF V2 fulfillment requests that
	// have already been fulfilled. This could happen if the request was fulfilled by another node.
	TransmitCheckerTypeVRFV2 = txmgrtypes.TransmitCheckerType("vrf_v2")

	// TransmitCheckerTypeVRFV2Plus is a checker that will not submit VRF V2 plus fulfillment requests that
	// have already been fulfilled. This could happen if the request was fulfilled by another node.
	TransmitCheckerTypeVRFV2Plus = txmgrtypes.TransmitCheckerType("vrf_v2plus")
)

Variables

View Source
var (
	ErrKeyNotUpdated = errors.New("evmTxStore: Key not updated")
	// ErrCouldNotGetReceipt is the error string we save if we reach our finality depth for a confirmed transaction without ever getting a receipt
	// This most likely happened because an external wallet used the account for this nonce
	ErrCouldNotGetReceipt = "could not get receipt"
)
View Source
var Max256BitUInt = big.NewInt(0).Exp(big.NewInt(2), big.NewInt(256), nil)

Functions

func DbEthTxAttemptStateToTxAttemptState added in v2.4.0

func DbEthTxAttemptStateToTxAttemptState(state string) txmgrtypes.TxAttemptState

func DbReceiptFromEvmReceipt added in v2.1.0

func DbReceiptFromEvmReceipt(evmReceipt *evmtypes.Receipt) dbReceipt

func DbReceiptToEvmReceipt added in v2.1.0

func DbReceiptToEvmReceipt(receipt *dbReceipt) *evmtypes.Receipt

func GetGethSignedTx added in v2.2.0

func GetGethSignedTx(signedRawTx []byte) (*types.Transaction, error)

GetGethSignedTx decodes the SignedRawTx into a types.Transaction struct

func MakeTestConfigs added in v2.8.0

func MakeTestConfigs(t *testing.T) (*MockConfig, *TestDatabaseConfig, *TestEvmConfig)

func NewEvmTxAttemptBuilder

func NewEvmTxAttemptBuilder(chainID big.Int, feeConfig evmTxAttemptBuilderFeeConfig, keystore TxAttemptSigner[common.Address], estimator gas.EvmFeeEstimator) *evmTxAttemptBuilder

func NewEvmTxmClient added in v2.2.0

func NewEvmTxmClient(c client.Client, clientErrors evmconfig.ClientErrors) *evmTxmClient

func NewEvmTxmConfig added in v2.1.0

func NewEvmTxmConfig(c ChainConfig) *evmTxmConfig

func NewEvmTxmFeeConfig added in v2.3.0

func NewEvmTxmFeeConfig(c FeeConfig) *evmTxmFeeConfig

func NewNonceTracker added in v2.11.0

func NewNonceTracker(lggr logger.Logger, txStore NonceTrackerTxStore, client NonceTrackerClient) *nonceTracker

func NewTxStore added in v2.1.0

func NewTxStore(
	db sqlutil.DataSource,
	lggr logger.Logger,
) *evmTxStore

Types

type Broadcaster added in v2.2.0

Type aliases for EVM

func NewEvmBroadcaster added in v2.2.0

func NewEvmBroadcaster(
	txStore TransactionStore,
	client TransactionClient,
	chainConfig txmgrtypes.BroadcasterChainConfig,
	feeConfig txmgrtypes.BroadcasterFeeConfig,
	txConfig txmgrtypes.BroadcasterTransactionsConfig,
	listenerConfig txmgrtypes.BroadcasterListenerConfig,
	keystore KeyStore,
	txAttemptBuilder TxAttemptBuilder,
	logger logger.Logger,
	checkerFactory TransmitCheckerFactory,
	autoSyncNonce bool,
) *Broadcaster

NewEvmBroadcaster returns a new concrete EvmBroadcaster

type ChainConfig added in v2.3.0

type ChainConfig interface {
	ChainType() config.ChainType
	FinalityDepth() uint32
	FinalityTagEnabled() bool
	NonceAutoSync() bool
	RPCDefaultBatchSize() uint32
}

ChainConfig encompasses config used by txmgr package Unless otherwise specified, these should support changing at runtime

type ChainReceipt added in v2.3.0

type ChainReceipt = txmgrtypes.ChainReceipt[common.Hash, common.Hash]

Type aliases for EVM

type CheckerFactory

type CheckerFactory struct {
	Client evmclient.Client
}

CheckerFactory is a real implementation of TransmitCheckerFactory.

func (*CheckerFactory) BuildChecker

func (c *CheckerFactory) BuildChecker(spec TransmitCheckerSpec) (TransmitChecker, error)

BuildChecker satisfies the TransmitCheckerFactory interface.

type Confirmer added in v2.2.0

Type aliases for EVM

func NewEvmConfirmer added in v2.2.0

func NewEvmConfirmer(
	txStore TxStore,
	client TxmClient,
	chainConfig txmgrtypes.ConfirmerChainConfig,
	feeConfig txmgrtypes.ConfirmerFeeConfig,
	txConfig txmgrtypes.ConfirmerTransactionsConfig,
	dbConfig txmgrtypes.ConfirmerDatabaseConfig,
	keystore KeyStore,
	txAttemptBuilder TxAttemptBuilder,
	lggr logger.Logger,
) *Confirmer

NewEvmConfirmer instantiates a new EVM confirmer

type DatabaseConfig added in v2.3.0

type DatabaseConfig interface {
	DefaultQueryTimeout() time.Duration
	LogSQL() bool
}

type DbEthTx added in v2.1.0

type DbEthTx struct {
	ID             int64
	IdempotencyKey *string
	Nonce          *int64
	FromAddress    common.Address
	ToAddress      common.Address
	EncodedPayload []byte
	Value          assets.Eth
	// GasLimit on the EthTx is always the conceptual gas limit, which is not
	// necessarily the same as the on-chain encoded value (i.e. Optimism)
	GasLimit uint64
	Error    nullv4.String
	// BroadcastAt is updated every time an attempt for this eth_tx is re-sent
	// In almost all cases it will be within a second or so of the actual send time.
	BroadcastAt *time.Time
	// InitialBroadcastAt is recorded once, the first ever time this eth_tx is sent
	CreatedAt time.Time
	State     txmgrtypes.TxState
	// Marshalled EvmTxMeta
	// Used for additional context around transactions which you want to log
	// at send time.
	Meta              *sqlutil.JSON
	Subject           uuid.NullUUID
	PipelineTaskRunID uuid.NullUUID
	MinConfirmations  null.Uint32
	EVMChainID        ubig.Big
	// TransmitChecker defines the check that should be performed before a transaction is submitted on
	// chain.
	TransmitChecker    *sqlutil.JSON
	InitialBroadcastAt *time.Time
	// Marks tx requiring callback
	SignalCallback bool
	// Marks tx callback as signaled
	CallbackCompleted bool
}

Directly maps to columns of database table "evm.txes". This is exported, as tests and other external code still directly reads DB using this schema.

func (*DbEthTx) FromTx added in v2.6.0

func (db *DbEthTx) FromTx(tx *Tx)

func (DbEthTx) ToTx added in v2.6.0

func (db DbEthTx) ToTx(tx *Tx)

type DbEthTxAttempt added in v2.1.0

type DbEthTxAttempt struct {
	ID                      int64
	EthTxID                 int64
	GasPrice                *assets.Wei
	SignedRawTx             []byte
	Hash                    common.Hash
	BroadcastBeforeBlockNum *int64
	State                   string
	CreatedAt               time.Time
	ChainSpecificGasLimit   uint64
	TxType                  int
	GasTipCap               *assets.Wei
	GasFeeCap               *assets.Wei
}

Directly maps to columns of database table "evm.tx_attempts". This is exported, as tests and other external code still directly reads DB using this schema.

func (*DbEthTxAttempt) FromTxAttempt added in v2.6.0

func (db *DbEthTxAttempt) FromTxAttempt(attempt *TxAttempt)

func (DbEthTxAttempt) ToTxAttempt added in v2.6.0

func (db DbEthTxAttempt) ToTxAttempt(attempt *TxAttempt)

type EvmBroadcasterConfig added in v2.1.0

type EvmBroadcasterConfig txmgrtypes.BroadcasterChainConfig

type EvmConfirmerConfig added in v2.1.0

type EvmConfirmerConfig txmgrtypes.ConfirmerChainConfig

type EvmReaperConfig added in v2.1.0

type EvmReaperConfig txmgrtypes.ReaperChainConfig

type EvmResenderConfig added in v2.1.0

type EvmResenderConfig txmgrtypes.ResenderChainConfig

type EvmTxStore added in v2.1.0

type EvmTxStore interface {
	// redeclare TxStore for mockery
	txmgrtypes.TxStore[common.Address, *big.Int, common.Hash, common.Hash, *evmtypes.Receipt, evmtypes.Nonce, gas.EvmFee]
	TxStoreWebApi
}

EvmTxStore combines the txmgr tx store interface and the interface needed for the API to read from the tx DB

type EvmTxmConfig added in v2.1.0

type EvmTxmFeeConfig added in v2.3.0

type FeeConfig added in v2.3.0

type FeeConfig interface {
	EIP1559DynamicFees() bool
	BumpPercent() uint16
	BumpThreshold() uint64
	BumpTxDepth() uint32
	LimitDefault() uint64
	PriceDefault() *assets.Wei
	TipCapMin() *assets.Wei
	PriceMax() *assets.Wei
	PriceMin() *assets.Wei
	PriceMaxKey(gethcommon.Address) *assets.Wei
}

type FwdMgr added in v2.3.0

Type aliases for EVM

type KeyStore

Type aliases for EVM

type ListenerConfig added in v2.3.0

type ListenerConfig interface {
	FallbackPollInterval() time.Duration
}

type MockConfig added in v2.8.0

type MockConfig struct {
	EvmConfig           *TestEvmConfig
	RpcDefaultBatchSize uint32
	// contains filtered or unexported fields
}

func (*MockConfig) ChainType added in v2.8.0

func (c *MockConfig) ChainType() commonconfig.ChainType

func (*MockConfig) EVM added in v2.8.0

func (c *MockConfig) EVM() evmconfig.EVM

func (*MockConfig) FinalityDepth added in v2.8.0

func (c *MockConfig) FinalityDepth() uint32

func (*MockConfig) FinalityTagEnabled added in v2.8.0

func (c *MockConfig) FinalityTagEnabled() bool

func (*MockConfig) NonceAutoSync added in v2.8.0

func (c *MockConfig) NonceAutoSync() bool

func (*MockConfig) RPCDefaultBatchSize added in v2.8.0

func (c *MockConfig) RPCDefaultBatchSize() uint32

func (*MockConfig) SetFinalityDepth added in v2.8.0

func (c *MockConfig) SetFinalityDepth(fd uint32)

type NonceTracker added in v2.11.0

Type aliases for EVM

type NonceTrackerClient added in v2.11.0

type NonceTrackerClient interface {
	ConfiguredChainID() *big.Int
	PendingSequenceAt(context.Context, common.Address) (evmtypes.Nonce, error)
}

type NonceTrackerTxStore added in v2.11.0

type NonceTrackerTxStore interface {
	FindLatestSequence(context.Context, common.Address, *big.Int) (evmtypes.Nonce, error)
}

type NullTxManager

Type aliases for EVM

type Reaper

type Reaper = txmgr.Reaper[*big.Int]

Type aliases for EVM

func NewEvmReaper added in v2.2.0

func NewEvmReaper(lggr logger.Logger, store txmgrtypes.TxHistoryReaper[*big.Int], config EvmReaperConfig, txConfig txmgrtypes.ReaperTransactionsConfig, chainID *big.Int) *Reaper

NewEvmReaper instantiates a new EVM-specific reaper object

type Receipt added in v2.3.0

type Receipt = dbReceipt // EvmReceipt is the exported DB table model for receipts

Type aliases for EVM

type ReceiptPlus added in v2.3.0

type ReceiptPlus = txmgrtypes.ReceiptPlus[*evmtypes.Receipt]

Type aliases for EVM

type Resender added in v2.2.0

Type aliases for EVM

func NewEvmResender added in v2.2.0

func NewEvmResender(
	lggr logger.Logger,
	txStore TransactionStore,
	client TransactionClient,
	tracker *Tracker,
	ks KeyStore,
	pollInterval time.Duration,
	config EvmResenderConfig,
	txConfig txmgrtypes.ResenderTransactionsConfig,
) *Resender

NewEvmResender creates a new concrete EvmResender

type SimulateChecker

type SimulateChecker struct {
	Client evmclient.Client
}

SimulateChecker simulates transactions, producing an error if they revert on chain.

func (*SimulateChecker) Check

func (s *SimulateChecker) Check(
	ctx context.Context,
	l logger.SugaredLogger,
	tx Tx,
	a TxAttempt,
) error

Check satisfies the TransmitChecker interface.

type TestBlockHistoryConfig added in v2.8.0

type TestBlockHistoryConfig struct {
	evmconfig.BlockHistory
}

func (*TestBlockHistoryConfig) BatchSize added in v2.8.0

func (b *TestBlockHistoryConfig) BatchSize() uint32

func (*TestBlockHistoryConfig) BlockDelay added in v2.8.0

func (b *TestBlockHistoryConfig) BlockDelay() uint16

func (*TestBlockHistoryConfig) BlockHistorySize added in v2.8.0

func (b *TestBlockHistoryConfig) BlockHistorySize() uint16

func (*TestBlockHistoryConfig) EIP1559FeeCapBufferBlocks added in v2.8.0

func (b *TestBlockHistoryConfig) EIP1559FeeCapBufferBlocks() uint16

func (*TestBlockHistoryConfig) TransactionPercentile added in v2.8.0

func (b *TestBlockHistoryConfig) TransactionPercentile() uint16

type TestDatabaseConfig added in v2.8.0

type TestDatabaseConfig struct {
	config.Database
	// contains filtered or unexported fields
}

func (*TestDatabaseConfig) DefaultQueryTimeout added in v2.8.0

func (d *TestDatabaseConfig) DefaultQueryTimeout() time.Duration

func (*TestDatabaseConfig) Listener added in v2.8.0

func (d *TestDatabaseConfig) Listener() config.Listener

func (*TestDatabaseConfig) LogSQL added in v2.8.0

func (d *TestDatabaseConfig) LogSQL() bool

type TestEvmConfig added in v2.8.0

type TestEvmConfig struct {
	evmconfig.EVM
	MaxInFlight          uint32
	ReaperInterval       time.Duration
	ReaperThreshold      time.Duration
	ResendAfterThreshold time.Duration
	BumpThreshold        uint64
	MaxQueued            uint64
}

func (*TestEvmConfig) FinalityDepth added in v2.8.0

func (e *TestEvmConfig) FinalityDepth() uint32

func (*TestEvmConfig) GasEstimator added in v2.8.0

func (e *TestEvmConfig) GasEstimator() evmconfig.GasEstimator

func (*TestEvmConfig) NonceAutoSync added in v2.8.0

func (e *TestEvmConfig) NonceAutoSync() bool

func (*TestEvmConfig) Transactions added in v2.8.0

func (e *TestEvmConfig) Transactions() evmconfig.Transactions

type TestEvmTxStore added in v2.3.0

type TestEvmTxStore interface {
	EvmTxStore

	// methods only used for testing purposes
	InsertReceipt(ctx context.Context, receipt *evmtypes.Receipt) (int64, error)
	InsertTx(ctx context.Context, etx *Tx) error
	FindTxAttemptsByTxIDs(ctx context.Context, ids []int64) ([]TxAttempt, error)
	InsertTxAttempt(ctx context.Context, attempt *TxAttempt) error
	LoadTxesAttempts(ctx context.Context, etxs []*Tx) error
	GetFatalTransactions(ctx context.Context) (txes []*Tx, err error)
	GetAllTxes(ctx context.Context) (txes []*Tx, err error)
	GetAllTxAttempts(ctx context.Context) (attempts []TxAttempt, err error)
	CountTxesByStateAndSubject(ctx context.Context, state txmgrtypes.TxState, subject uuid.UUID) (count int, err error)
	FindTxesByFromAddressAndState(ctx context.Context, fromAddress common.Address, state string) (txes []*Tx, err error)
	UpdateTxAttemptBroadcastBeforeBlockNum(ctx context.Context, id int64, blockNum uint) error
}

type TestGasEstimatorConfig added in v2.8.0

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

func (*TestGasEstimatorConfig) BlockHistory added in v2.8.0

func (g *TestGasEstimatorConfig) BlockHistory() evmconfig.BlockHistory

func (*TestGasEstimatorConfig) BumpMin added in v2.8.0

func (g *TestGasEstimatorConfig) BumpMin() *assets.Wei

func (*TestGasEstimatorConfig) BumpPercent added in v2.8.0

func (g *TestGasEstimatorConfig) BumpPercent() uint16

func (*TestGasEstimatorConfig) BumpThreshold added in v2.8.0

func (g *TestGasEstimatorConfig) BumpThreshold() uint64

func (*TestGasEstimatorConfig) BumpTxDepth added in v2.8.0

func (g *TestGasEstimatorConfig) BumpTxDepth() uint32

func (*TestGasEstimatorConfig) EIP1559DynamicFees added in v2.8.0

func (g *TestGasEstimatorConfig) EIP1559DynamicFees() bool

func (*TestGasEstimatorConfig) FeeCapDefault added in v2.8.0

func (g *TestGasEstimatorConfig) FeeCapDefault() *assets.Wei

func (*TestGasEstimatorConfig) LimitDefault added in v2.8.0

func (g *TestGasEstimatorConfig) LimitDefault() uint64

func (*TestGasEstimatorConfig) LimitJobType added in v2.8.0

func (g *TestGasEstimatorConfig) LimitJobType() evmconfig.LimitJobType

func (*TestGasEstimatorConfig) LimitMax added in v2.8.0

func (g *TestGasEstimatorConfig) LimitMax() uint64

func (*TestGasEstimatorConfig) LimitMultiplier added in v2.8.0

func (g *TestGasEstimatorConfig) LimitMultiplier() float32

func (*TestGasEstimatorConfig) LimitTransfer added in v2.8.0

func (g *TestGasEstimatorConfig) LimitTransfer() uint64

func (*TestGasEstimatorConfig) Mode added in v2.8.0

func (g *TestGasEstimatorConfig) Mode() string

func (*TestGasEstimatorConfig) PriceDefault added in v2.8.0

func (g *TestGasEstimatorConfig) PriceDefault() *assets.Wei

func (*TestGasEstimatorConfig) PriceMax added in v2.8.0

func (g *TestGasEstimatorConfig) PriceMax() *assets.Wei

func (*TestGasEstimatorConfig) PriceMaxKey added in v2.8.0

func (g *TestGasEstimatorConfig) PriceMaxKey(addr common.Address) *assets.Wei

func (*TestGasEstimatorConfig) PriceMin added in v2.8.0

func (g *TestGasEstimatorConfig) PriceMin() *assets.Wei

func (*TestGasEstimatorConfig) TipCapDefault added in v2.8.0

func (g *TestGasEstimatorConfig) TipCapDefault() *assets.Wei

func (*TestGasEstimatorConfig) TipCapMin added in v2.8.0

func (g *TestGasEstimatorConfig) TipCapMin() *assets.Wei

type TestLimitJobTypeConfig added in v2.8.0

type TestLimitJobTypeConfig struct {
}

func (*TestLimitJobTypeConfig) DR added in v2.8.0

func (l *TestLimitJobTypeConfig) DR() *uint32

func (*TestLimitJobTypeConfig) FM added in v2.8.0

func (l *TestLimitJobTypeConfig) FM() *uint32

func (*TestLimitJobTypeConfig) Keeper added in v2.8.0

func (l *TestLimitJobTypeConfig) Keeper() *uint32

func (*TestLimitJobTypeConfig) OCR added in v2.8.0

func (l *TestLimitJobTypeConfig) OCR() *uint32

func (*TestLimitJobTypeConfig) OCR2 added in v2.8.0

func (l *TestLimitJobTypeConfig) OCR2() *uint32

func (*TestLimitJobTypeConfig) VRF added in v2.8.0

func (l *TestLimitJobTypeConfig) VRF() *uint32

type TestListenerConfig added in v2.8.0

type TestListenerConfig struct {
	config.Listener
}

func (*TestListenerConfig) FallbackPollInterval added in v2.8.0

func (l *TestListenerConfig) FallbackPollInterval() time.Duration

type Tracker added in v2.8.0

Type aliases for EVM

func NewEvmTracker added in v2.8.0

func NewEvmTracker(
	txStore TxStore,
	keyStore KeyStore,
	chainID *big.Int,
	lggr logger.Logger,
) *Tracker

NewEvmTracker instantiates a new EVM tracker for abandoned transactions

type TransactionClient added in v2.3.0

Type aliases for EVM

type TransactionStore added in v2.3.0

Type aliases for EVM

type TransmitChecker

var (
	// NoChecker is a TransmitChecker that always determines a transaction should be submitted.
	NoChecker TransmitChecker = noChecker{}
)

type TransmitCheckerFactory

Type aliases for EVM

type Tx added in v2.3.0

Type aliases for EVM

type TxAttempt added in v2.3.0

Type aliases for EVM

type TxAttemptBuilder added in v2.3.0

Type aliases for EVM

type TxAttemptSigner

type TxAttemptSigner[ADDR commontypes.Hashable] interface {
	SignTx(ctx context.Context, fromAddress ADDR, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
}

type TxManager

Type aliases for EVM

func NewTxm

func NewTxm(
	ds sqlutil.DataSource,
	chainConfig ChainConfig,
	fCfg FeeConfig,
	txConfig config.Transactions,
	clientErrors config.ClientErrors,
	dbConfig DatabaseConfig,
	listenerConfig ListenerConfig,
	client evmclient.Client,
	lggr logger.Logger,
	logPoller logpoller.LogPoller,
	keyStore keystore.Eth,
	estimator gas.EvmFeeEstimator,
) (txm TxManager,
	err error,
)

NewTxm constructs the necessary dependencies for the EvmTxm (broadcaster, confirmer, etc) and returns a new EvmTxManager

type TxMeta added in v2.3.0

Type aliases for EVM

type TxRequest added in v2.3.0

Type aliases for EVM

type TxStore added in v2.3.0

Type aliases for EVM

type TxStoreWebApi added in v2.3.0

type TxStoreWebApi interface {
	FindTxAttemptConfirmedByTxIDs(ctx context.Context, ids []int64) ([]TxAttempt, error)
	FindTxByHash(ctx context.Context, hash common.Hash) (*Tx, error)
	Transactions(ctx context.Context, offset, limit int) ([]Tx, int, error)
	TxAttempts(ctx context.Context, offset, limit int) ([]TxAttempt, int, error)
	TransactionsWithAttempts(ctx context.Context, offset, limit int) ([]Tx, int, error)
	FindTxAttempt(ctx context.Context, hash common.Hash) (*TxAttempt, error)
	FindTxWithAttempts(ctx context.Context, etxID int64) (etx Tx, err error)
}

TxStoreWebApi encapsulates the methods that are not used by the txmgr and only used by the various web controllers and readers

type Txm

Type aliases for EVM

func NewEvmTxm added in v2.3.0

func NewEvmTxm(
	chainId *big.Int,
	cfg txmgrtypes.TransactionManagerChainConfig,
	txCfg txmgrtypes.TransactionManagerTransactionsConfig,
	keyStore KeyStore,
	lggr logger.Logger,
	checkerFactory TransmitCheckerFactory,
	fwdMgr FwdMgr,
	txAttemptBuilder TxAttemptBuilder,
	txStore TxStore,
	broadcaster *Broadcaster,
	confirmer *Confirmer,
	resender *Resender,
	tracker *Tracker,
) *Txm

NewEvmTxm creates a new concrete EvmTxm

type TxmClient added in v2.3.0

Type aliases for EVM

type VRFV1Checker

type VRFV1Checker struct {

	// Callbacks checks whether a VRF V1 request has already been fulfilled on the VRFCoordinator
	// Solidity contract
	Callbacks func(opts *bind.CallOpts, reqID [32]byte) (v1.Callbacks, error)

	Client evmclient.Client
}

VRFV1Checker is an implementation of TransmitChecker that checks whether a VRF V1 fulfillment has already been fulfilled.

func (*VRFV1Checker) Check

func (v *VRFV1Checker) Check(
	ctx context.Context,
	l logger.SugaredLogger,
	tx Tx,
	_ TxAttempt,
) error

Check satisfies the TransmitChecker interface.

type VRFV2Checker

type VRFV2Checker struct {

	// GetCommitment checks whether a VRF V2 request has been fulfilled on the VRFCoordinatorV2
	// Solidity contract.
	GetCommitment func(opts *bind.CallOpts, requestID *big.Int) ([32]byte, error)

	// HeadByNumber fetches the head given the number. If nil is provided,
	// the latest header is fetched.
	HeadByNumber func(ctx context.Context, n *big.Int) (*types.Head, error)

	// RequestBlockNumber is the block number of the VRFV2 request.
	RequestBlockNumber *big.Int
}

VRFV2Checker is an implementation of TransmitChecker that checks whether a VRF V2 fulfillment has already been fulfilled.

func (*VRFV2Checker) Check

func (v *VRFV2Checker) Check(
	ctx context.Context,
	l logger.SugaredLogger,
	tx Tx,
	_ TxAttempt,
) error

Check satisfies the TransmitChecker interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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