observation

package
v0.0.0-...-fd3cab2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package observation contains the data structures and logic for handling observations provided by the client DataSource. Its role is to encapsulate the Observation type so that it can be changed relatively easily.

Index

Constants

This section is empty.

Variables

View Source
var MaxObservation = i(0).Sub(i(0).Lsh(i(1), bitWidth-1), i(1)) // 2**191 - 1
View Source
var MinObservation = i(0).Sub(i(0).Neg(MaxObservation), i(1)) // -2**191

Functions

func GenObservation

func GenObservation() gopter.Gen

Types

type Observation

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

func MakeObservation

func MakeObservation(w types.Observation) (Observation, error)

MakeObservation returns v as an ethereum int192, if it fits, errors otherwise.

func UnmarshalObservation

func UnmarshalObservation(s []byte) (Observation, error)

func XXXTestingOnlyNewObservation

func XXXTestingOnlyNewObservation(v *big.Int) Observation

XXXTestingOnlyNewObservation returns a new observation with no bounds checking on v.

func (Observation) Deviates

func (o Observation) Deviates(old Observation, thresholdPPB uint64) bool

func (Observation) Equal

func (o Observation) Equal(o2 Observation) bool

func (Observation) GoEthereumValue

func (o Observation) GoEthereumValue() *big.Int

func (Observation) IsMissingValue

func (o Observation) IsMissingValue() bool

func (Observation) Less

func (o Observation) Less(o2 Observation) bool

func (Observation) Marshal

func (o Observation) Marshal() []byte

Bytes returns the twos-complement representation of o

This panics on OOB values, because MakeObservation and UnmarshalObservation are the only external ways to create an Observation, and that already checks the bounds

func (Observation) MarshalText

func (o Observation) MarshalText() (text []byte, err error)

func (Observation) RawObservation

func (o Observation) RawObservation() *big.Int

func (Observation) String

func (o Observation) String() string

type Observations

type Observations []Observation

Jump to

Keyboard shortcuts

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