directrequestocr

package
v1.11.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ExtractRawBytes added in v1.11.0

func ExtractRawBytes(input []byte) ([]byte, error)

Process result from the EA saved by a jsonparse pipeline task. That value is a valid JSON string so it contains double quote characters. Allowed inputs are:

  1. "" (2 characters) -> return empty byte array
  2. "0x<val>" where <val> is a non-empty, valid hex -> return hex-decoded <val>

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(requestID RequestID, receivedAt time.Time, requestTxHash *common.Hash, qopts ...pg.QOpt) error

	SetResult(requestID RequestID, runID int64, computationResult []byte, readyAt time.Time, qopts ...pg.QOpt) error
	SetError(requestID RequestID, runID int64, errorType ErrType, computationError []byte, readyAt time.Time, qopts ...pg.QOpt) error
	SetState(requestID RequestID, state RequestState, qopts ...pg.QOpt) (RequestState, error)

	FindOldestEntriesByState(state RequestState, limit uint32, qopts ...pg.QOpt) ([]Request, error)
	FindById(requestID RequestID, qopts ...pg.QOpt) (*Request, error)
}

type Request

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

type RequestID added in v1.11.0

type RequestID [32]byte

func (RequestID) String added in v1.11.0

func (r RequestID) String() 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