types

package module
v0.0.0-...-86a10a9 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 2 Imported by: 0

README

Prysm shared types

Documentation

Overview

Package types contains types shared between various parts of the system (beacon chain, validator, slasher).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Epoch

type Epoch uint64

Epoch represents a single epoch.

func MaxEpoch

func MaxEpoch(a, b Epoch) Epoch

MaxEpoch returns the larger of the two epochs.

func MinEpoch

func MinEpoch(a, b Epoch) Epoch

MinEpoch returns the smaller of the two epochs.

func (Epoch) Add

func (e Epoch) Add(x uint64) Epoch

Add increases epoch by x.

func (Epoch) AddEpoch

func (e Epoch) AddEpoch(x Epoch) Epoch

AddEpoch increases epoch using another epoch value.

func (Epoch) AddSlot

func (e Epoch) AddSlot(x Slot) Epoch

AddSlot increases epoch using slot value.

func (Epoch) Div

func (e Epoch) Div(x uint64) Epoch

Div divides epoch by x.

func (Epoch) HashTreeRoot

func (e Epoch) HashTreeRoot() ([32]byte, error)

HashTreeRoot returns calculated hash root.

func (Epoch) HashTreeRootWith

func (e Epoch) HashTreeRootWith(hh *fssz.Hasher) error

HashWithDefaultHasher hashes a HashRoot object with a Hasher from the default HasherPool.

func (*Epoch) MarshalSSZ

func (e *Epoch) MarshalSSZ() ([]byte, error)

MarshalSSZ marshals epoch into a serialized object.

func (*Epoch) MarshalSSZTo

func (e *Epoch) MarshalSSZTo(dst []byte) ([]byte, error)

MarshalSSZTo marshals epoch with the provided byte slice.

func (Epoch) Mod

func (e Epoch) Mod(x uint64) Epoch

Mod returns result of `epoch % x`.

func (Epoch) ModSlot

func (e Epoch) ModSlot(x Slot) Epoch

Mod returns result of `epoch % slot`.

func (Epoch) Mul

func (e Epoch) Mul(x uint64) Epoch

Mul multiplies epoch by x.

func (*Epoch) SizeSSZ

func (e *Epoch) SizeSSZ() int

SizeSSZ returns the size of the serialized object.

func (Epoch) Sub

func (e Epoch) Sub(x uint64) Epoch

Sub subtracts x from the epoch.

func (*Epoch) UnmarshalSSZ

func (e *Epoch) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ deserializes the provided bytes buffer into the epoch object.

type Slot

type Slot uint64

Slot represents a single slot.

func MaxSlot

func MaxSlot(a, b Slot) Slot

MaxSlot returns the larger of the two slots.

func MinSlot

func MinSlot(a, b Slot) Slot

MinSlot returns the smaller of the two slots.

func (Slot) Add

func (s Slot) Add(x uint64) Slot

Add increases slot by x.

func (Slot) AddEpoch

func (s Slot) AddEpoch(x Epoch) Slot

AddEpoch increases slot using epoch value.

func (Slot) AddSlot

func (s Slot) AddSlot(x Slot) Slot

AddSlot increases slot by another slot.

func (Slot) Div

func (s Slot) Div(x uint64) Slot

Div divides slot by x.

func (Slot) DivEpoch

func (s Slot) DivEpoch(x Epoch) Slot

DivEpoch divides slot using epoch value.

func (Slot) DivSlot

func (s Slot) DivSlot(x Slot) Slot

DivSlot divides slot by another slot.

func (Slot) HashTreeRoot

func (s Slot) HashTreeRoot() ([32]byte, error)

HashTreeRoot returns calculated hash root.

func (Slot) HashTreeRootWith

func (s Slot) HashTreeRootWith(hh *fssz.Hasher) error

HashWithDefaultHasher hashes a HashRoot object with a Hasher from the default HasherPool.

func (*Slot) MarshalSSZ

func (s *Slot) MarshalSSZ() ([]byte, error)

MarshalSSZ marshals slot into a serialized object.

func (*Slot) MarshalSSZTo

func (s *Slot) MarshalSSZTo(dst []byte) ([]byte, error)

MarshalSSZTo marshals slot with the provided byte slice.

func (Slot) Mod

func (s Slot) Mod(x uint64) Slot

Mod returns result of `slot % x`.

func (Slot) ModEpoch

func (s Slot) ModEpoch(x Epoch) Slot

ModEpoch returns result of `slot % epoch`.

func (Slot) ModSlot

func (s Slot) ModSlot(x Slot) Slot

ModSlot returns result of `slot % slot`.

func (Slot) Mul

func (s Slot) Mul(x uint64) Slot

Mul multiplies slot by x.

func (Slot) MulEpoch

func (s Slot) MulEpoch(x Epoch) Slot

MulEpoch multiplies slot using epoch value.

func (Slot) MulSlot

func (s Slot) MulSlot(x Slot) Slot

MulSlot multiplies slot by another slot.

func (*Slot) SizeSSZ

func (s *Slot) SizeSSZ() int

SizeSSZ returns the size of the serialized object.

func (Slot) Sub

func (s Slot) Sub(x uint64) Slot

Sub subtracts x from the slot.

func (Slot) SubEpoch

func (s Slot) SubEpoch(x Epoch) Slot

SubEpoch subtracts value of epoch type from the slot.

func (Slot) SubSlot

func (s Slot) SubSlot(x Slot) Slot

SubSlot finds difference between two slot values.

func (*Slot) UnmarshalSSZ

func (s *Slot) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ deserializes the provided bytes buffer into the slot object.

Jump to

Keyboard shortcuts

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