Documentation
¶
Index ¶
- Constants
- type Store
- func (s *Store) CreateEvent(event *store.Event) error
- func (s *Store) GetConfirmedEvents(currentBlock uint64, minBlockConfirmation uint64) ([]store.Event, error)
- func (s *Store) GetEvent(eventID string) (*store.Event, error)
- func (s *Store) ResetInProgressEventsToConfirmed() (int64, error)
- func (s *Store) UpdateBroadcastedTxHash(eventID, txHash string) error
- func (s *Store) UpdateStatus(eventID, status, errorMsg string) error
- func (s *Store) UpdateStatusAndBlockHeight(eventID, status string, blockHeight uint64) error
Constants ¶
const ( StatusConfirmed = "CONFIRMED" // StatusInProgress - TSS signing is in progress StatusInProgress = "IN_PROGRESS" // StatusBroadcasted - Transaction sent to external chain (for sign events) StatusBroadcasted = "BROADCASTED" // StatusCompleted - Successfully completed (key events: vote sent, sign events: confirmed) StatusCompleted = "COMPLETED" // StatusReverted - Event reverted StatusReverted = "REVERTED" // StatusExpired - Event expired (for key events) StatusExpired = "EXPIRED" )
Event statuses for TSS operations
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) CreateEvent ¶
CreateEvent stores a new PCEvent. Returns error if event already exists.
func (*Store) GetConfirmedEvents ¶ added in v0.0.13
func (s *Store) GetConfirmedEvents(currentBlock uint64, minBlockConfirmation uint64) ([]store.Event, error)
GetConfirmedEvents returns all confirmed events that are ready to be processed. Events are confirmed if they are at least `minBlockConfirmation` blocks behind the current block and not expired. This method returns events that have been confirmed on-chain (have enough block confirmations).
func (*Store) ResetInProgressEventsToConfirmed ¶ added in v0.0.13
ResetInProgressEventsToConfirmed resets all IN_PROGRESS events to CONFIRMED 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) UpdateBroadcastedTxHash ¶ added in v0.0.13
UpdateBroadcastedTxHash updates the BroadcastedTxHash field for an event (used after broadcasting).
func (*Store) UpdateStatus ¶
UpdateStatus updates the status of an event. Note: errorMsg is logged but not stored (Event model doesn't have error_msg field).