Documentation ¶
Overview ¶
Package receipt keeps track of transaction receipts for a number of ticks. A receipt consists of any errors that were encountered while processing a transaction's message, as well as the message's result
Index ¶
- Variables
- type History
- func (h *History) AddError(hash types.TxHash, err error)
- func (h *History) GetReceipt(hash types.TxHash) (Receipt, bool)
- func (h *History) GetReceiptsForTick(tick uint64) ([]Receipt, error)
- func (h *History) NextTick()
- func (h *History) SetResult(hash types.TxHash, result any)
- func (h *History) SetTick(tick uint64)
- func (h *History) Size() uint64
- type Receipt
Constants ¶
This section is empty.
Variables ¶
var ( ErrTickHasNotBeenProcessed = errors.New("tick is still in progress") ErrOldTickHasBeenDiscarded = errors.New("the requested tick has been discarded due to age") )
Functions ¶
This section is empty.
Types ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
History keeps track of transaction "receipts" (the result of a transaction and any associated errors) for some number of ticks.
func NewHistory ¶
NewHistory creates a object that can track transaction receipts over a number of ticks.
func (*History) AddError ¶
AddError associates the given error with the given transaction hash. Calling this multiple times will append the error any previously added errors.
func (*History) GetReceipt ¶
GetReceipt gets the receipt (the transaction result and the list of errors) for the given transaction hash in the current tick. To get receipts from previous ticks use GetReceiptsForTick.
func (*History) GetReceiptsForTick ¶
GetReceiptsForTick gets all receipts for the given tick. If the tick is still active, or if the tick is too far in the past, an error is returned.
func (*History) NextTick ¶
func (h *History) NextTick()
NextTick advances the internal History tick by 1. Errors and results can only be set on the current tick. Receipts from ticks in the past are read only.