message

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AcrossMessage = "AcrossMessage"

	ZERO_HASH   = "0000000000000000000000000000000000000000000000000000000000000000"
	DOMAIN_NAME = "LiquidityPool"
	VERSION     = "1.0.0"
	PROTOCOL_ID = 1
	BLOCK_RANGE = 1000

	TIMEOUT = 10 * time.Minute
)

Variables

This section is empty.

Functions

func NewAcrossMessage

func NewAcrossMessage(source, destination uint64, acrossData AcrossData) *message.Message

Types

type AcrossData

type AcrossData struct {
	DepositId     *big.Int
	Nonce         *big.Int
	LiquidityPool common.Address
	Caller        common.Address
	Coordinator   peer.ID
	ErrChn        chan error
}

type AcrossMessageHandler

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

func NewAcrossMessageHandler

func NewAcrossMessageHandler(
	chainID uint64,
	client EventFilterer,
	pools map[uint64]common.Address,
	coordinator Coordinator,
	host host.Host,
	comm comm.Communication,
	fetcher signing.SaveDataFetcher,
	tokenPricer TokenPricer,
	tokenMatcher TokenMatcher,
	sigChn chan any,
	tokens map[string]evm.TokenConfig,
	confirmations map[uint64]uint64,
	blocktime time.Duration,
) *AcrossMessageHandler

func (*AcrossMessageHandler) HandleMessage

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

HandleMessage finds the Across deposit with the according deposit ID and starts the MPC signature process for it. The result will be saved into the signature cache through the result channel.

func (*AcrossMessageHandler) Listen

func (h *AcrossMessageHandler) Listen(ctx context.Context)

type Coordinator

type Coordinator interface {
	Execute(ctx context.Context, tssProcesses []tss.TssProcess, resultChn chan interface{}, coordinator peer.ID) error
}

type EventFilterer

type EventFilterer interface {
	FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
	LatestBlock() (*big.Int, error)
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

type TokenMatcher

type TokenMatcher interface {
	DestinationToken(destinationChainId *big.Int, symbol string) (common.Address, error)
}

type TokenPricer

type TokenPricer interface {
	TokenPrice(symbol string) (float64, error)
}

Directories

Path Synopsis
Package mock_message is a generated GoMock package.
Package mock_message is a generated GoMock package.

Jump to

Keyboard shortcuts

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