ethverifier

package
v0.74.0-preview.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	Send(event events.Event)
	SendBatch(events []events.Event)
}

Broker interface. Do not need to mock (use package broker/mock).

type CallEngine

type CallEngine interface {
	MakeResult(specID string, bytes []byte) (ethcall.Result, error)
	CallSpec(ctx context.Context, id string, atBlock uint64) (ethcall.Result, error)
}

type EthCallEngine

type EthCallEngine interface {
	MakeResult(specID string, bytes []byte) (ethcall.Result, error)
	CallSpec(ctx context.Context, id string, atBlock uint64) (ethcall.Result, error)
	GetEthTime(ctx context.Context, atBlock uint64) (uint64, error)
	GetRequiredConfirmations(specId string) (uint64, error)
	GetInitialTriggerTime(id string) (uint64, error)
	StartAtHeight(height uint64, timestamp uint64)
	Start()
}

type EthereumConfirmations

type EthereumConfirmations interface {
	CheckRequiredConfirmations(block uint64, required uint64) error
}

type OracleDataBroadcaster

type OracleDataBroadcaster interface {
	BroadcastData(context.Context, common.Data) error
}

type Result

type Result interface {
	Bytes() []byte
	Values() ([]any, error)
	Normalised() (map[string]string, error)
	PassesFilters() (bool, error)
	HasRequiredConfirmations() bool
}

type TimeService

type TimeService interface {
	GetTimeNow() time.Time
}

TimeService interface.

type Verifier

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

func New

func New(
	log *logging.Logger,
	witness Witness,
	ts TimeService,
	broker Broker,
	oracleBroadcaster OracleDataBroadcaster,
	ethCallEngine EthCallEngine,
	ethConfirmations EthereumConfirmations,
) (sv *Verifier)

func (*Verifier) GetState

func (s *Verifier) GetState(k string) ([]byte, []types.StateProvider, error)

func (*Verifier) Keys

func (s *Verifier) Keys() []string

func (*Verifier) LoadState

func (s *Verifier) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)

func (*Verifier) Namespace

func (s *Verifier) Namespace() types.SnapshotNamespace

func (*Verifier) OnStateLoaded

func (s *Verifier) OnStateLoaded(ctx context.Context) error

func (*Verifier) OnTick

func (s *Verifier) OnTick(ctx context.Context, t time.Time)

func (*Verifier) ProcessEthereumContractCallResult

func (s *Verifier) ProcessEthereumContractCallResult(callEvent ethcall.ContractCallEvent) error

func (*Verifier) Stopped

func (s *Verifier) Stopped() bool

type Witness

type Witness interface {
	StartCheckWithDelay(validators.Resource, func(interface{}, bool), time.Time, int64) error
	RestoreResource(validators.Resource, func(interface{}, bool)) error
}

Directories

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

Jump to

Keyboard shortcuts

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