medianreport

package
v0.0.1-beta-test Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnchainConfigVersion = 1
)

Variables

This section is empty.

Functions

func RawReportContext

func RawReportContext(repctx types.ReportContext) [3][32]byte

NOTE: this should sit in the ocr2 package but that causes import cycles

func SplitReport

func SplitReport(report types.Report) ([][]byte, error)

Types

type OnchainConfigCodec

type OnchainConfigCodec struct{}

func (OnchainConfigCodec) Decode

func (codec OnchainConfigCodec) Decode(b []byte) (median.OnchainConfig, error)

Decode converts the onchainconfig via the outputs of DecodeToFelts into unsigned big.Ints that libocr expects

func (OnchainConfigCodec) DecodeToFelts

func (codec OnchainConfigCodec) DecodeToFelts(b []byte) ([]*big.Int, error)

DecodeToFelts decodes the onchainconfig into felt values (used in config digest hashing)

func (OnchainConfigCodec) Encode

func (codec OnchainConfigCodec) Encode(c median.OnchainConfig) ([]byte, error)

Encode takes the interface that libocr uses (big.Ints) and serializes it into 3 felts

func (OnchainConfigCodec) EncodeFromFelt

func (codec OnchainConfigCodec) EncodeFromFelt(version, min, max *big.Int) ([]byte, error)

EncodeFromFelt encodes the config where min & max are big.Int representations of a felt Cairo has no notion of signed values: min and max values will be non-negative

type ReportCodec

type ReportCodec struct{}

func (ReportCodec) BuildReport

func (ReportCodec) MaxReportLength

func (c ReportCodec) MaxReportLength(n int) (int, error)

func (ReportCodec) MedianFromReport

func (c ReportCodec) MedianFromReport(report types.Report) (*big.Int, error)

Jump to

Keyboard shortcuts

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