chaintime

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chaintime

type Chaintime struct {
	Genesis        time.Time
	SecondsPerSlot uint64
	SlotsPerEpoch  uint64
}

func New

func New(genesis time.Time, secondsPerSlot, slotsPerEpoch uint64) *Chaintime

func (*Chaintime) CurrentEpoch

func (c *Chaintime) CurrentEpoch() Epoch

func (*Chaintime) CurrentSlot

func (c *Chaintime) CurrentSlot() Slot

func (*Chaintime) Epoch

func (c *Chaintime) Epoch(epoch uint64) Epoch

func (*Chaintime) IsActive

func (c *Chaintime) IsActive() bool

func (*Chaintime) Slot

func (c *Chaintime) Slot(slot uint64) Slot

func (*Chaintime) SlotToEpoch

func (c *Chaintime) SlotToEpoch(slot uint64) uint64

type Epoch

type Epoch struct {
	Number uint64
	Time   time.Time
}

func (Epoch) C

func (e Epoch) C() *time.Timer

func (Epoch) Until

func (e Epoch) Until() time.Duration

type Slot

type Slot struct {
	Number uint64
	Time   time.Time
	Epoch  uint64
}

func (Slot) C

func (s Slot) C() *time.Timer

Jump to

Keyboard shortcuts

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