Documentation ¶
Overview ¶
Package submitter provides a simple interface for submitting txs to multiple chains and retrying.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotStarted = errors.New("submitter is not started")
ErrNotStarted is the error for when the submitter is not started.
var ErrSubmitterAlreadyStarted = errors.New("submitter already started")
ErrSubmitterAlreadyStarted is the error for when the submitter is already started.
Functions ¶
This section is empty.
Types ¶
type ClientFetcher ¶
type ClientFetcher interface {
GetClient(ctx context.Context, chainID *big.Int) (client.EVM, error)
}
ClientFetcher is the interface for fetching a chain client.
type ContractCallType ¶
type ContractCallType func(transactor *bind.TransactOpts) (tx *types.Transaction, err error)
ContractCallType is a contract call that can be called safely.
type SubmissionState ¶ added in v0.0.100
type SubmissionState uint8
SubmissionState is the status of a submission. This is not used internally and only serves as a way to communicate the status of a submission to the caller.
const ( // NotFound indicates that the submission was not found. NotFound SubmissionState = iota // Pending indicates that the submission is pending. Pending // pending // Confirming indicates that the submission is confirming. The tx has completed on chain, but // no txhash has been associated with it yet. Confirming // confirming // Confirmed indicates that the submission is confirmed and txhash data is available. Confirmed // confirmed )
func (SubmissionState) String ¶ added in v0.0.100
func (i SubmissionState) String() string
type SubmissionStatus ¶ added in v0.0.100
type SubmissionStatus interface { // State is the state of the submission. State() SubmissionState // HasTx indicates whether the submission has a transaction. HasTx() bool // TxHash is the hash of the transaction. This will be the zero hash if HasTx is false. TxHash() common.Hash }
SubmissionStatus is the status of a submission.
type TransactionSubmitter ¶
type TransactionSubmitter interface { // Start starts the transaction submitter. Start(ctx context.Context) error // SubmitTransaction submits a transaction to the chain. // the transaction is not guaranteed to be executed immediately, only at some point in the future. // the nonce is returned, and can be used to track the status of the transaction. SubmitTransaction(ctx context.Context, chainID *big.Int, call ContractCallType) (nonce uint64, err error) // GetSubmissionStatus returns the status of a transaction and any metadata associated with it if it is complete. GetSubmissionStatus(ctx context.Context, chainID *big.Int, nonce uint64) (status SubmissionStatus, err error) // Address returns the address of the signer. Address() common.Address // Started returns whether the submitter is running. Started() bool }
TransactionSubmitter is the interface for submitting transactions to the chain.
func NewTransactionSubmitter ¶
func NewTransactionSubmitter(metrics metrics.Handler, signer signer.Signer, fetcher ClientFetcher, db db.Service, config config.IConfig) TransactionSubmitter
NewTransactionSubmitter creates a new transaction submitter.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package config provides a configuration struct and getters for the submitter.
|
Package config provides a configuration struct and getters for the submitter. |
Package db provides a database interface for the submitter.
|
Package db provides a database interface for the submitter. |
txdb
Package txdb provides a database implementation that simplements the submitter db service.
|
Package txdb provides a database implementation that simplements the submitter db service. |