domains

package
v0.0.138 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package domains contains adapters for each domain

Index

Constants

This section is empty.

Variables

View Source
var ErrNoUpdate = errors.New("no update produced")

ErrNoUpdate indicates no update has been produced.

Functions

This section is empty.

Types

type DestinationContract added in v0.0.60

type DestinationContract interface {
	//// SubmitAttestation submits an attestation to the destination.
	// SubmitAttestation(ctx context.Context, signer signer.Signer, attestation types.SignedAttestation) error
	// Execute executes a message on the destination.
	Execute(ctx context.Context, signer signer.Signer, message types.Message, originProof [32][32]byte, snapshotProof [][32]byte, index *big.Int) error
	// AttestationsAmount retrieves the number of attestations submitted to the destination.
	AttestationsAmount(ctx context.Context) (uint64, error)
	// SubmitAttestation submits an attestation to the destination
	SubmitAttestation(ctx context.Context, signer signer.Signer, attPayload []byte, signature signer.Signature) error
}

DestinationContract contains the interface for the destination.

type DomainClient

type DomainClient interface {
	// Name gets the name of the client. This can be used for logging.
	Name() string
	// Config gets the config that was used to create the client.
	Config() config.DomainConfig
	// BlockNumber gets the latest block
	BlockNumber(ctx context.Context) (uint32, error)
	// Origin retrieves a handle for the origin contract
	Origin() OriginContract
	// Summit is the summit
	Summit() SummitContract
	// Destination retrieves a handle for the destination contract
	Destination() DestinationContract
}

DomainClient represents a client used for interacting with contracts in a particular domain. The goal of a domain is that the particulars of interacting with an eth vs a solana contract are abstracted away and can be done through a set of common interfaces.

type OriginContract

type OriginContract interface {
	// FetchSortedMessages fetches all messages in order form lowest->highest in a given block range
	FetchSortedMessages(ctx context.Context, from uint32, to uint32) (messages []types.CommittedMessage, err error)
	// SuggestLatestState gets the latest state on the origin
	SuggestLatestState(ctx context.Context) (types.State, error)
	// SuggestState gets the state on the origin with the given nonce if it exists
	SuggestState(ctx context.Context, nonce uint32) (types.State, error)
}

OriginContract represents the origin contract on a particular chain.

type PingPongClientContract added in v0.0.110

type PingPongClientContract interface {
	// DoPing sends a ping message through the PingPongClient.
	DoPing(ctx context.Context, signer signer.Signer, destination uint32, recipient common.Address, pings uint16) error
	WatchPingSent(ctx context.Context, sink chan<- *pingpongclient.PingPongClientPingSent) (event.Subscription, error)
	WatchPongReceived(ctx context.Context, sink chan<- *pingpongclient.PingPongClientPongReceived) (event.Subscription, error)
}

PingPongClientContract contains the interface for the ping pong test client.

type SummitContract added in v0.0.130

type SummitContract interface {
	// AddAgent adds an agent (guard or notary) to the summit
	AddAgent(transactOpts *bind.TransactOpts, domain uint32, signer signer.Signer) error
	// SubmitSnapshot submits a snapshot to the summit.
	SubmitSnapshot(ctx context.Context, signer signer.Signer, encodedSnapshot []byte, signature signer.Signature) error
	// GetLatestState gets the latest state signed by any guard for the given origin
	GetLatestState(ctx context.Context, origin uint32) (types.State, error)
	// GetLatestAgentState gets the latest state signed by the bonded signer for the given origin
	GetLatestAgentState(ctx context.Context, origin uint32, bondedAgentSigner signer.Signer) (types.State, error)
	// WatchAttestationSaved looks for attesation saved events
	WatchAttestationSaved(ctx context.Context, sink chan<- *summit.SummitAttestationSaved) (event.Subscription, error)
}

SummitContract contains the interface for the summit.

type TestClientContract added in v0.0.105

type TestClientContract interface {
	// SendMessage sends a message through the TestClient.
	SendMessage(ctx context.Context, signer signer.Signer, destination uint32, recipient common.Address, optimisticSeconds uint32, message []byte) error
}

TestClientContract contains the interface for the test client.

Directories

Path Synopsis
Package evm TODO description
Package evm TODO description

Jump to

Keyboard shortcuts

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