chaintime

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// GenesisTime provides the time of the chain's genesis.
	GenesisTime() time.Time
	// StartOfSlot provides the time at which a given slot starts.
	StartOfSlot(slot spec.Slot) time.Time
	// StartOfEpoch provides the time at which a given epoch starts.
	StartOfEpoch(epoch spec.Epoch) time.Time
	// CurrentSlot provides the current slot.
	CurrentSlot() spec.Slot
	// CurrentEpoch provides the current epoch.
	CurrentEpoch() spec.Epoch
	// SlotToEpoch provides the epoch of the given slot.
	SlotToEpoch(slot spec.Slot) spec.Epoch
	// FirstSlotOfEpoch provides the first slot of the given epoch.
	FirstSlotOfEpoch(epoch spec.Epoch) spec.Slot
	// TimestampToSlot provides the slot of the given timestamp.
	TimestampToSlot(timestamp time.Time) spec.Slot
	// TimestampToEpoch provides the epoch of the given timestamp.
	TimestampToEpoch(timestamp time.Time) spec.Epoch
}

Service provides a number of functions for calculating chain-related times.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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