message

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: LGPL-2.1 Imports: 19 Imported by: 0

Documentation

Index

Constants

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) *message.Message

func NewEvmStateRootMessage

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

Types

type AccountProof

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

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 Client

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)
}

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(
	blockFetcher BlockFetcher,
	blockStorer BlockStorer,
	client Client,
	routerAddress common.Address,
	msgChan chan []*message.Message,
	domainID uint8,
	slotIndex uint8,
	genericResources []string,
	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 StorageProof

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

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