message

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HashiMessage  message.MessageType   = "HashiMessage"
	HashiProposal proposal.ProposalType = "HashiProposal"
)
View Source
const (
	EVMStateRootMessage message.MessageType = "EVMStateRootMessage"
	MAX_BLOCK_RANGE     int64               = 1000
)
View Source
const (
	EVMTransferMessage  message.MessageType   = "EVMTransferMessage"
	EVMTransferProposal proposal.ProposalType = "EVMTransferProposal"

	GenericTransfer  TransferType = "genericTransfer"
	FungibleTransfer TransferType = "fungibleTransfer"
)

Variables

This section is empty.

Functions

func NewEVMTransferMessage

func NewEVMTransferMessage(source uint8, destination uint8, transfer TransferData, messageID string) *message.Message

func NewEvmStateRootMessage

func NewEvmStateRootMessage(source uint8, destination uint8, stateRoot StateRootData, messageID string) *message.Message

func NewHashiMessage added in v1.0.3

func NewHashiMessage(source uint8, destination uint8, data HashiData, messageID string) *message.Message

Types

type BlockFetcher

type BlockFetcher interface {
	SignedBeaconBlock(ctx context.Context, opts *api.SignedBeaconBlockOpts) (*api.Response[*spec.VersionedSignedBeaconBlock], error)
}

type BlockStorer

type BlockStorer interface {
	StoreBlock(sourceDomainID uint8, destinationDomainID uint8, blockNumber *big.Int) error
	LatestBlock(sourceDomainID uint8, destinationDomainID uint8) (*big.Int, error)
}

type EventHandler added in v1.0.3

type EventHandler interface {
	HandleEvents(destination uint8, startBlock *big.Int, endBlock *big.Int, slot *big.Int) error
}

type HashiData added in v1.0.3

type HashiData struct {
	SrcSlot           *big.Int
	TxSlot            *big.Int
	ReceiptRootProof  [][]byte
	ReceiptRoot       [32]byte
	ReceiptProof      [][]byte
	TxIndexRLPEncoded []byte
	LogIndex          *big.Int
}

type HashiMessageHandler added in v1.0.3

type HashiMessageHandler struct{}

func (*HashiMessageHandler) HandleMessage added in v1.0.3

func (h *HashiMessageHandler) HandleMessage(m *message.Message) (*proposal.Proposal, error)

type StateRootData

type StateRootData struct {
	StateRoot [32]byte
	Slot      *big.Int
}

type StateRootHandler

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

func NewStateRootHandler

func NewStateRootHandler(
	domainID uint8,
	eventHandlers []EventHandler,
	blockFetcher BlockFetcher,
	blockStorer BlockStorer,
	startBlock *big.Int,
) *StateRootHandler

func (*StateRootHandler) HandleMessage

func (h *StateRootHandler) HandleMessage(m *message.Message) (*proposal.Proposal, error)

HandleMessage fetches deposits for the given state root and submits a transfer message with execution state proofs per transfer

type TransferData

type TransferData struct {
	Deposit      *events.Deposit
	Slot         *big.Int
	AccountProof []string
	StorageProof []string
	Type         TransferType
}

type TransferHandler

type TransferHandler struct{}

func (*TransferHandler) HandleMessage

func (h *TransferHandler) HandleMessage(m *message.Message) (*proposal.Proposal, error)

type TransferType

type TransferType string

Jump to

Keyboard shortcuts

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