Documentation ¶
Index ¶
- func Erc20DepositHandler(sourceID, destId uint8, nonce uint64, resourceID types.ResourceID, ...) (*message.Message, error)
- func Erc721DepositHandler(sourceID, destId uint8, nonce uint64, resourceID types.ResourceID, ...) (*message.Message, error)
- func GenericDepositHandler(sourceID, destId uint8, nonce uint64, resourceID types.ResourceID, ...) (*message.Message, error)
- type ChainClient
- type DepositEventHandler
- type DepositHandler
- type DepositHandlerFunc
- type DepositHandlers
- type ETHDepositHandler
- type EVMListener
- type EventHandler
- type EventListener
- type HandlerMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Erc20DepositHandler ¶
func Erc20DepositHandler(sourceID, destId uint8, nonce uint64, resourceID types.ResourceID, calldata, handlerResponse []byte) (*message.Message, error)
Erc20DepositHandler converts data pulled from event logs into message handlerResponse can be an empty slice
func Erc721DepositHandler ¶
func Erc721DepositHandler(sourceID, destId uint8, nonce uint64, resourceID types.ResourceID, calldata, handlerResponse []byte) (*message.Message, error)
Erc721DepositHandler converts data pulled from ERC721 deposit event logs into message
func GenericDepositHandler ¶
func GenericDepositHandler(sourceID, destId uint8, nonce uint64, resourceID types.ResourceID, calldata, handlerResponse []byte) (*message.Message, error)
GenericDepositHandler converts data pulled from generic deposit event logs into message
Types ¶
type ChainClient ¶
type DepositEventHandler ¶
type DepositEventHandler struct {
// contains filtered or unexported fields
}
func NewDepositEventHandler ¶
func NewDepositEventHandler(eventListener EventListener, depositHandler DepositHandler, bridgeAddress common.Address, domainID uint8) *DepositEventHandler
func (*DepositEventHandler) HandleEvent ¶
type DepositHandler ¶
type DepositHandlerFunc ¶
type DepositHandlers ¶
type DepositHandlers map[common.Address]DepositHandlerFunc
type ETHDepositHandler ¶
type ETHDepositHandler struct {
// contains filtered or unexported fields
}
func NewETHDepositHandler ¶
func NewETHDepositHandler(handlerMatcher HandlerMatcher) *ETHDepositHandler
NewETHDepositHandler creates an instance of ETHDepositHandler that contains handler functions for processing deposit events
func (*ETHDepositHandler) HandleDeposit ¶
func (e *ETHDepositHandler) HandleDeposit(sourceID, destID uint8, depositNonce uint64, resourceID types.ResourceID, calldata, handlerResponse []byte) (*message.Message, error)
func (*ETHDepositHandler) RegisterDepositHandler ¶
func (e *ETHDepositHandler) RegisterDepositHandler(handlerAddress string, handler DepositHandlerFunc)
RegisterDepositHandler registers an event handler by associating a handler function to a specified address
type EVMListener ¶
type EVMListener struct {
// contains filtered or unexported fields
}
func NewEVMListener ¶
func NewEVMListener(client ChainClient, eventHandlers []EventHandler, blockstore *store.BlockStore, config *chain.EVMConfig) *EVMListener
NewEVMListener creates an EVMListener that listens to deposit events on chain and calls event handler when one occurs
func (*EVMListener) ListenToEvents ¶
func (l *EVMListener) ListenToEvents(ctx context.Context, block *big.Int, msgChan chan *message.Message, msgChan1 chan *message.Message2, errChn chan<- error)
ListenToEvents goes block by block of a network and executes event handlers that are configured for the listener.
type EventHandler ¶
type EventListener ¶
type HandlerMatcher ¶
type HandlerMatcher interface {
GetHandlerAddressForResourceID(resourceID types.ResourceID) (common.Address, error)
}