Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BHS ¶
type BHS interface { // Store the hash associated with blockNum. Store(ctx context.Context, blockNum uint64) error // IsStored checks whether the hash associated with blockNum is already stored. IsStored(ctx context.Context, blockNum uint64) (bool, error) }
BHS defines an interface for interacting with a BlockhashStore contract.
type BulletproofBHS ¶
type BulletproofBHS struct {
// contains filtered or unexported fields
}
BulletproofBHS is an implementation of BHS that writes "store" transactions to a bulletproof transaction manager, and reads BlockhashStore state from the contract.
func NewBulletproofBHS ¶
func NewBulletproofBHS( config bpBHSConfig, fromAddress common.Address, txm txmgr.TxManager, bhs blockhash_store.BlockhashStoreInterface, ) (*BulletproofBHS, error)
NewBulletproofBHS creates a new instance with the given transaction manager and blockhash store.
type Coordinator ¶
type Coordinator interface { // Requests fetches VRF requests that occurred within the specified blocks. Requests(ctx context.Context, fromBlock uint64, toBlock uint64) ([]Event, error) // Fulfillments fetches VRF fulfillments that occurred since the specified block. Fulfillments(ctx context.Context, fromBlock uint64) ([]Event, error) }
Coordinator defines an interface for fetching request and fulfillment metadata from a VRF coordinator.
func NewMultiCoordinator ¶
func NewMultiCoordinator(coordinators ...Coordinator) Coordinator
NewMultiCoordinator creates a new Coordinator that combines the results of the given coordinators.
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
Delegate creates BlockhashStore feeder jobs.
func NewDelegate ¶
NewDelegate creates a new Delegate.
func (*Delegate) AfterJobCreated ¶
AfterJobCreated satisfies the job.Delegate interface.
func (*Delegate) BeforeJobDeleted ¶
BeforeJobDeleted satisfies the job.Delegate interface.
func (*Delegate) ServicesForSpec ¶
ServicesForSpec satisfies the job.Delegate interface.
type Event ¶
type Event struct { // ID of the relevant VRF request. For a VRF V1 request, this will an encoded 32 byte array. // For VRF V2, it will be an integer in string form. ID string // Block that the request or fulfillment was included in. Block uint64 }
Event contains metadata about a VRF randomness request or fulfillment.
type Feeder ¶
type Feeder struct {
// contains filtered or unexported fields
}
Feeder checks recent VRF coordinator events and stores any blockhashes for blocks within waitBlocks and lookbackBlocks that have unfulfilled requests.
type MultiCoordinator ¶
type MultiCoordinator []Coordinator
MultiCoordinator combines the data from multiple coordinators.
func (MultiCoordinator) Fulfillments ¶
Fulfillments satisfies the Coordinator interface.
type V1Coordinator ¶
type V1Coordinator struct {
// contains filtered or unexported fields
}
V1Coordinator fetches request and fulfillment logs from a VRF V1 coordinator contract.
func NewV1Coordinator ¶
func NewV1Coordinator(c v1.VRFCoordinatorInterface) *V1Coordinator
NewV1Coordinator creates a new V1Coordinator from the given contract.
func (*V1Coordinator) Fulfillments ¶
Fulfillments satisfies the Coordinator interface.
type V2Coordinator ¶
type V2Coordinator struct {
// contains filtered or unexported fields
}
V2Coordinator fetches request and fulfillment logs from a VRF V2 coordinator contract.
func NewV2Coordinator ¶
func NewV2Coordinator(c v2.VRFCoordinatorV2Interface) *V2Coordinator
NewV2Coordinator creates a new V2Coordinator from the given contract.
func (*V2Coordinator) Fulfillments ¶
Fulfillments satisfies the Coordinator interface.