types

package
v0.0.0-...-3674750 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadRelayConfig = errors.New("bad relay config")

Functions

This section is empty.

Types

type ChainContractReader

type ChainContractReader struct {
	ContractABI string `json:"contractABI"`
	// ChainReaderDefinitions key is chainAgnostic read name.
	ChainReaderDefinitions map[string]ChainReaderDefinition `json:"chainReaderDefinitions"`
}

type ChainReaderConfig

type ChainReaderConfig struct {
	// ChainContractReaders key is contract name
	ChainContractReaders map[string]ChainContractReader `json:"chainContractReaders"`
}

type ChainReaderDefinition

type ChainReaderDefinition struct {
	ChainSpecificName string         `json:"chainSpecificName"` // chain specific contract method name or event type.
	Params            map[string]any `json:"params"`
	ReturnValues      []string       `json:"returnValues"`
	CacheEnabled      bool           `json:"cacheEnabled"`
	ReadType          ReadType       `json:"readType"`
}

type ConfigPoller

type ConfigPoller interface {
	ocrtypes.ContractConfigTracker

	Start()
	Close() error
	Replay(ctx context.Context, fromBlock int64) error
}

type FunctionsProvider

type FunctionsProvider interface {
	commontypes.FunctionsProvider
	LogPollerWrapper() LogPollerWrapper
}

TODO(FUN-668): Migrate this fully into commontypes.FunctionsProvider

type LogPollerWrapper

type LogPollerWrapper interface {
	services.Service
	LatestEvents() ([]OracleRequest, []OracleResponse, error)

	// TODO (FUN-668): Remove from the LOOP interface and only use internally within the EVM relayer
	SubscribeToUpdates(name string, subscriber RouteUpdateSubscriber)
}

A LogPoller wrapper that understands router proxy contracts

type OracleRequest

type OracleRequest struct {
	RequestId           [32]byte
	RequestingContract  common.Address
	RequestInitiator    common.Address
	SubscriptionId      uint64
	SubscriptionOwner   common.Address
	Data                []byte
	DataVersion         uint16
	Flags               [32]byte
	CallbackGasLimit    uint64
	TxHash              common.Hash
	CoordinatorContract common.Address
	OnchainMetadata     []byte
}

type OracleResponse

type OracleResponse struct {
	RequestId [32]byte
}

type ReadType

type ReadType int64
const (
	Method ReadType = 0
	Event  ReadType = 1
)

type RelayConfig

type RelayConfig struct {
	ChainID                *big.Big           `json:"chainID"`
	FromBlock              uint64             `json:"fromBlock"`
	EffectiveTransmitterID null.String        `json:"effectiveTransmitterID"`
	ConfigContractAddress  *common.Address    `json:"configContractAddress"`
	ChainReader            *ChainReaderConfig `json:"chainReader"`

	// Contract-specific
	SendingKeys pq.StringArray `json:"sendingKeys"`

	// Mercury-specific
	FeedID *common.Hash `json:"feedID"`
}

type RelayOpts

type RelayOpts struct {
	// TODO BCF-2508 -- should anyone ever get the raw config bytes that are embedded in args? if not,
	// make this private and wrap the arg fields with funcs on RelayOpts
	commontypes.RelayArgs
	// contains filtered or unexported fields
}

func NewRelayOpts

func NewRelayOpts(args types.RelayArgs) *RelayOpts

func (*RelayOpts) RelayConfig

func (o *RelayOpts) RelayConfig() (RelayConfig, error)

type RouteUpdateSubscriber

type RouteUpdateSubscriber interface {
	UpdateRoutes(activeCoordinator common.Address, proposedCoordinator common.Address) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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