directrequestocr

package
v1.10.0-beta0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParseResultTaskName string = "parse_result"
	ParseErrorTaskName  string = "parse_error"
)

Variables

This section is empty.

Functions

func NewInMemoryORM

func NewInMemoryORM() *inmemoryorm

Types

type DRListener

type DRListener struct {
	utils.StartStopOnce
	// contains filtered or unexported fields
}

func NewDRListener

func NewDRListener(oracle *ocr2dr_oracle.OCR2DROracle, jb job.Job, runner pipeline.Runner, jobORM job.ORM, pluginORM ORM, pluginConfig config.PluginConfig, logBroadcaster log.Broadcaster, lggr logger.Logger) *DRListener

func (*DRListener) Close

func (l *DRListener) Close() error

Close complies with job.Service

func (*DRListener) HandleLog

func (l *DRListener) HandleLog(lb log.Broadcast)

HandleLog() complies with log.Listener

func (*DRListener) JobID

func (l *DRListener) JobID() int32

JobID() complies with log.Listener

func (*DRListener) Start

func (l *DRListener) Start(context.Context) error

Start complies with job.Service

type ErrType

type ErrType int8
const (
	NONE ErrType = iota
	NODE_EXCEPTION
	SANDBOX_TIMEOUT
	USER_EXCEPTION
)

func (ErrType) String

func (e ErrType) String() string

type ORM

type ORM interface {
	CreateRequest(contractRequestID [32]byte, receivedAt time.Time, requestTxHash *common.Hash) (int64, error)

	SetResult(id int64, runID int64, computationResult []byte, readyAt time.Time) error
	SetError(id int64, runID int64, errorType ErrType, computationError string, readyAt time.Time) error
	SetConfirmed(contractRequestID [32]byte) error
}

type Request

type Request struct {
	ID                int64
	ContractRequestID [32]byte
	RunID             int64
	ReceivedAt        time.Time
	RequestTxHash     *common.Hash
	State             RequestState
	ResultReadyAt     time.Time
	Result            []byte
	ErrorType         ErrType
	Error             string
	// True if this node submitted an observation for this request in any OCR rounds.
	IsOCRParticipant  bool
	TransmittedResult []byte
	TransmittedError  string
}

type RequestState

type RequestState int8
const (
	IN_PROGRESS RequestState = iota
	RESULT_READY
	TRANSMITTED
	CONFIRMED
)

func (RequestState) String

func (s RequestState) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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