Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Noncer ¶
type Noncer struct {
// contains filtered or unexported fields
}
Noncer is a struct that manages nonces for transactions.
func (*Noncer) Acquire ¶
Acquire gets the next available nonce. Along with the nonce to use, it returns whether this nonce is replacing another tx in the mempool that has the same nonce (in this case, a replacement with bumped gas should be used).
func (*Noncer) RemoveAcquired ¶
RemoveAcquired removes a nonce from the acquired list, when a transaction is unable to be sent.
func (*Noncer) RemoveInFlight ¶
RemoveInFlight removes a transaction from the in-flight list by its nonce.
func (*Noncer) SetInFlight ¶
SetInFlight adds a transaction to the in-flight list. The transaction is indexed by its nonce.
type Response ¶
type Response struct { *coretypes.Transaction MsgIDs []string // Message IDs that were included in the transaction. InitialTimes []time.Time // Times each message was initially fired. Error error // Build or send error. // contains filtered or unexported fields }
Response represents a transaction that is currently being tracked by the transactor.
func (*Response) Hash ¶
Hash overrides the method on Transaction to avoid dereferencing a nil pointer.
func (*Response) Nonce ¶
Nonce overrides the method on Transaction to avoid dereferencing a nil pointer.
type Status ¶
type Status uint8
Status represents the current status of a tx owned by the transactor. These are used only after the tx status has been confirmed by erroring, the chain, or the configured timeout.
type Subscriber ¶
type Subscriber interface { // OnError is called when a transaction request fails to build or send. OnError(ctx context.Context, resp *Response) // OnSuccess is called when a transaction has been successfully included in a block. OnSuccess(resp *Response, receipt *coretypes.Receipt) // OnRevert is called when a transaction has been reverted. OnRevert(resp *Response, receipt *coretypes.Receipt) // OnStale is called when a transaction becomes stale after the configured timeout. OnStale(ctx context.Context, resp *Response, isPending bool) }
Subscriber is an interface that defines methods for handling responses from the transactor.
type Subscription ¶
type Subscription struct { Subscriber // contains filtered or unexported fields }
Once started, a Subscription manages and invokes a Subscriber.
func NewSubscription ¶
func NewSubscription(s Subscriber, logger log.Logger) *Subscription
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is a component that keeps track of the transactions that are already sent to the chain.