types

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const MaxTopicFields = 3

MaxTopicFields is three because the EVM has a max of four topics, but the first topic is always the event signature.

Variables

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

Functions

func GetMaxSize added in v2.9.0

func GetMaxSize(n int, args abi.Arguments) (int, error)

func SizedBigIntType added in v2.9.0

func SizedBigIntType() reflect.Type

Types

type ABIEncodingType added in v2.9.0

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

func GetAbiEncodingType added in v2.9.0

func GetAbiEncodingType(name string) (*ABIEncodingType, bool)

type ChainCodecConfig added in v2.9.0

type ChainCodecConfig struct {
	TypeABI         string                `json:"typeAbi" toml:"typeABI"`
	ModifierConfigs codec.ModifiersConfig `toml:"modifierConfigs,omitempty"`
}

type ChainContractReader added in v2.9.0

type ChainContractReader struct {
	ContractABI string `json:"contractABI" toml:"contractABI"`
	// key is genericName from config
	Configs map[string]*ChainReaderDefinition `json:"configs" toml:"configs"`
}

type ChainReaderConfig added in v2.9.0

type ChainReaderConfig struct {
	// Contracts key is contract name
	Contracts map[string]ChainContractReader `json:"contracts" toml:"contracts"`
}

type ChainReaderDefinition added in v2.9.0

type ChainReaderDefinition chainReaderDefinitionFields

func (*ChainReaderDefinition) MarshalText added in v2.9.0

func (d *ChainReaderDefinition) MarshalText() ([]byte, error)

func (*ChainReaderDefinition) UnmarshalText added in v2.9.0

func (d *ChainReaderDefinition) UnmarshalText(b []byte) error

type CodecConfig added in v2.9.0

type CodecConfig struct {
	// Configs key is the type's name for the codec
	Configs map[string]ChainCodecConfig `json:"configs" toml:"configs"`
}

type CodecEntry added in v2.9.0

type CodecEntry interface {
	Init() error
	Args() abi.Arguments
	EncodingPrefix() []byte
	GetMaxSize(n int) (int, error)
	Modifier() codec.Modifier

	// CheckedType provides a type that can be used to decode into with type-safety around sizes of integers etc.
	CheckedType() reflect.Type

	// ToNative converts a pointer to checked value into a pointer of a type to use with the go-ethereum ABI encoder
	// Note that modification of the returned value will modify the original checked value and vice versa.
	ToNative(checked reflect.Value) (reflect.Value, error)

	// IsNativePointer returns if the type is a pointer to the native type
	IsNativePointer(item reflect.Type) bool
}

func NewCodecEntry added in v2.9.0

func NewCodecEntry(args abi.Arguments, encodingPrefix []byte, mod codec.Modifier) CodecEntry

type ConfigPoller added in v2.3.0

type ConfigPoller interface {
	ocrtypes.ContractConfigTracker

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

type FunctionsProvider added in v2.5.0

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

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

type LogPollerWrapper added in v2.5.0

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

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

A LogPoller wrapper that understands router proxy contracts

type OracleRequest added in v2.5.0

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 added in v2.5.0

type OracleResponse struct {
	RequestId [32]byte
}

type ReadType added in v2.9.0

type ReadType int
const (
	Method ReadType = iota
	Event
)

func (ReadType) MarshalText added in v2.9.0

func (r ReadType) MarshalText() ([]byte, error)

func (ReadType) String added in v2.9.0

func (r ReadType) String() string

func (*ReadType) UnmarshalText added in v2.9.0

func (r *ReadType) UnmarshalText(text []byte) error

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"`
	Codec                  *CodecConfig       `json:"codec"`

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

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

type RelayOpts added in v2.5.0

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
	types.RelayArgs
	// contains filtered or unexported fields
}

func NewRelayOpts added in v2.5.0

func NewRelayOpts(args types.RelayArgs) *RelayOpts

func (*RelayOpts) RelayConfig added in v2.5.0

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

type RouteUpdateSubscriber added in v2.5.0

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

type SizedBigInt added in v2.9.0

type SizedBigInt interface {
	Verify() error
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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