handlers

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: LGPL-2.1 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVMStateRootMessage message.MessageType = "EVMStateRootMessage"
)
View Source
const (
	MAX_BLOCK_RANGE int64 = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountProof added in v1.0.3

type AccountProof struct {
	AccountProof []string       `json:"accountProof"`
	StorageProof []StorageProof `json:"storageProof"`
}

type BeaconClient added in v1.0.3

type BeaconClient interface {
	BeaconBlockHeader(
		ctx context.Context,
		opts *api.BeaconBlockHeaderOpts,
	) (
		*api.Response[*apiv1.BeaconBlockHeader],
		error,
	)
}

type Client added in v1.0.3

type Client interface {
	CallContext(ctx context.Context, target interface{}, rpcMethod string, args ...interface{}) error
	FetchEventLogs(ctx context.Context, contractAddress common.Address, event string, startBlock *big.Int, endBlock *big.Int) ([]types.Log, error)
	BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

type DepositEventHandler added in v1.0.3

type DepositEventHandler struct {
	// contains filtered or unexported fields
}

func NewDepositEventHandler added in v1.0.3

func NewDepositEventHandler(
	domainID uint8,
	client Client,
	routerAddres common.Address,
	slotIndex uint8,
	genericResources []string,
	msgChan chan []*message.Message) *DepositEventHandler

func (*DepositEventHandler) HandleEvents added in v1.0.3

func (h *DepositEventHandler) HandleEvents(destination uint8, startBlock *big.Int, endBlock *big.Int, slot *big.Int) error

type EventFetcher

type EventFetcher interface {
	FetchEventLogs(ctx context.Context, contractAddress common.Address, event string, startBlock *big.Int, endBlock *big.Int) ([]types.Log, error)
}

type HashiEventHandler added in v1.0.3

type HashiEventHandler struct {
	// contains filtered or unexported fields
}

func NewHashiEventHandler added in v1.0.3

func NewHashiEventHandler(
	domainID uint8,
	client Client,
	beaconClient BeaconClient,
	receiptProver ReceiptProver,
	rootProver RootProver,
	yahoAddress common.Address,
	chainIDS map[uint8]uint64,
	msgChan chan []*message.Message) *HashiEventHandler

func (*HashiEventHandler) HandleEvents added in v1.0.3

func (h *HashiEventHandler) HandleEvents(destination uint8, startBlock *big.Int, endBlock *big.Int, slot *big.Int) error

type ReceiptProver added in v1.0.3

type ReceiptProver interface {
	ReceiptProof(txHash common.Hash) ([][]byte, error)
}

type RootProver added in v1.0.3

type RootProver interface {
	ReceiptsRootProof(ctx context.Context, currentSlot *big.Int, targetSlot *big.Int) ([][]byte, error)
}

type StateRootEventHandler

type StateRootEventHandler struct {
	// contains filtered or unexported fields
}

func NewStateRootEventHandler

func NewStateRootEventHandler(
	msgChan chan []*message.Message,
	eventFetcher EventFetcher,
	stateRootAddress common.Address,
	domainID uint8,
) *StateRootEventHandler

func (*StateRootEventHandler) HandleEvents

func (h *StateRootEventHandler) HandleEvents(startBlock *big.Int, endBlock *big.Int) error

HandleEvents fetches state root submitted events and sends message to origin domain

type StorageProof added in v1.0.3

type StorageProof struct {
	Proof []string `json:"proof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL