Documentation ¶
Index ¶
- type BridgeEventManager
- func (b *BridgeEventManager) AddBridgeEvents(events []types.BridgeEvent) error
- func (b *BridgeEventManager) GetBridgeEventById(id uint32) (event types.BridgeEvent, timestamp time.Time, found bool)
- func (b *BridgeEventManager) GetNow() time.Time
- func (b *BridgeEventManager) GetRecognizedEventInfo() types.BridgeEventInfo
- func (b *BridgeEventManager) SetRecognizedEventInfo(eventInfo types.BridgeEventInfo) error
- type BridgeEventWithTime
- type EventId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeEventManager ¶
type BridgeEventManager struct { // Exclusive mutex taken when reading or writing sync.Mutex // contains filtered or unexported fields }
BridgeEventManager maintains a map of "Recognized" Bridge Events. That is, events that have been finalized on Ethereum but are not yet in consensus on the V4 chain. Methods are goroutine safe.
func NewBridgeEventManager ¶
func NewBridgeEventManager( timeProvider libtime.TimeProvider, ) *BridgeEventManager
NewBridgeEventManager creates a new BridgeEventManager.
func (*BridgeEventManager) AddBridgeEvents ¶
func (b *BridgeEventManager) AddBridgeEvents( events []types.BridgeEvent, ) error
AddBridgeEvents adds bridge events to the manager (with timestamps). Added events must have contiguous and in-order IDs. Any events with ID less than the `recognizedEventInfo.NextId` are ignored.
func (*BridgeEventManager) GetBridgeEventById ¶
func (b *BridgeEventManager) GetBridgeEventById( id uint32, ) ( event types.BridgeEvent, timestamp time.Time, found bool, )
GetBridgeEventById returns a bridge event by ID. Found is false if the manager does not have the event.
func (*BridgeEventManager) GetNow ¶
func (b *BridgeEventManager) GetNow() time.Time
func (*BridgeEventManager) GetRecognizedEventInfo ¶
func (b *BridgeEventManager) GetRecognizedEventInfo() types.BridgeEventInfo
GetRecognizedEventInfo returns `recognizedEventInfo`.
func (*BridgeEventManager) SetRecognizedEventInfo ¶
func (b *BridgeEventManager) SetRecognizedEventInfo( eventInfo types.BridgeEventInfo, ) error
SetRecognizedEventInfo sets `recognizedEventInfo`. An error is returned and no update occurs if `NextId` or `EthBlockHeight` is lesser than its existing value.
type BridgeEventWithTime ¶
type BridgeEventWithTime struct {
// contains filtered or unexported fields
}
BridgeEventWithTime is a type that wraps BridgeEvent but also holds an additional timestamp.