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 ¶
- Variables
- func GenObservation() gopter.Gen
- type Observation
- func (o Observation) Deviates(old Observation, thresholdPPB uint64) bool
- func (o Observation) Equal(o2 Observation) bool
- func (o Observation) GoEthereumValue() *big.Int
- func (o Observation) IsMissingValue() bool
- func (o Observation) Less(o2 Observation) bool
- func (o Observation) Marshal() []byte
- func (o Observation) MarshalText() (text []byte, err error)
- func (o Observation) RawObservation() *big.Int
- func (o Observation) String() string
- type Observations
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 ¶
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
Click to show internal directories.
Click to hide internal directories.