SlotConfig

scalus.cardano.ledger.SlotConfig
See theSlotConfig companion object
case class SlotConfig(zeroTime: Long, zeroSlot: Long, slotLength: Long, epochLength: Long = ..., zeroEpoch: Long = ...)

Slot and epoch configuration for a Cardano network.

Encodes the linear (post-Byron) era as an anchor point: slot zeroSlot starts at zeroTime (POSIX milliseconds) and falls at the beginning of epoch zeroEpoch; slots are slotLength milliseconds long and epochs are epochLength slots long.

The java.time.Instant conversions live in SlotConfigPlatform, which JavaScript does not have; the arithmetic below is the same on every platform, and SlotConfigParityTest pins it.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(zeroTime: Long, zeroSlot: Long, slotLength: Long)

Concrete methods

def epochOf(slot: Long): Long

Epoch containing the given slot. Slots before zeroSlot are clamped to zeroEpoch.

Epoch containing the given slot. Slots before zeroSlot are clamped to zeroEpoch.

Attributes

def firstSlotOfEpoch(epoch: Long): Long

First slot of the given epoch (for epochs >= zeroEpoch).

First slot of the given epoch (for epochs >= zeroEpoch).

Attributes

def slotToTime(slot: Long): Long
def timeToSlot(time: Long): Long

Inherited methods

def instantToSlot(instant: Instant): Long

The slot containing the given instant, truncating within the slot.

The slot containing the given instant, truncating within the slot.

Attributes

Inherited from:
SlotConfigPlatform (hidden)
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def slotToInstant(slot: Long): Instant

The instant at which the given slot starts.

The instant at which the given slot starts.

Attributes

Inherited from:
SlotConfigPlatform (hidden)