Documentation
¶
Index ¶
- Constants
- type Store
- func (s *Store) ClearExpiredAndSuccessfulEvents() (int64, error)
- func (s *Store) CreateEvent(event *store.TSSEvent) error
- func (s *Store) GetEvent(eventID string) (*store.TSSEvent, error)
- func (s *Store) GetEventsByStatus(status string, limit int) ([]store.TSSEvent, error)
- func (s *Store) GetPendingEvents(currentBlock uint64, minBlockConfirmation uint64) ([]store.TSSEvent, error)
- func (s *Store) ResetInProgressEventsToPending() (int64, error)
- func (s *Store) UpdateStatus(eventID, status, errorMsg string) error
- func (s *Store) UpdateStatusAndBlockNumber(eventID, status string, blockNumber uint64) error
Constants ¶
const ( StatusPending = "PENDING" StatusInProgress = "IN_PROGRESS" StatusSuccess = "SUCCESS" StatusExpired = "EXPIRED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides database access for TSS events.
func (*Store) ClearExpiredAndSuccessfulEvents ¶
ClearExpiredAndSuccessfulEvents deletes both expired and successful events.
func (*Store) CreateEvent ¶
CreateEvent stores a new TSSEvent. Returns error if event already exists.
func (*Store) GetEventsByStatus ¶
GetEventsByStatus returns all events with the given status.
func (*Store) GetPendingEvents ¶
func (s *Store) GetPendingEvents(currentBlock uint64, minBlockConfirmation uint64) ([]store.TSSEvent, error)
GetPendingEvents returns all pending events that are ready to be processed. Events are ready if they are at least `minBlockConfirmation` blocks behind the current block.
func (*Store) ResetInProgressEventsToPending ¶
ResetInProgressEventsToPending resets all IN_PROGRESS events to PENDING status. This should be called on node startup to handle cases where the node crashed while events were in progress, causing sessions to be lost from memory.
func (*Store) UpdateStatus ¶
UpdateStatus updates the status of an event.