Crate snapshots_math
source · [−]Expand description
Calculations for voting escrow snapshots.
These functions are split into a separate crate to ensure anchor-lang
version mismatches
do not prevent building against this code.
Constants
The Unix timestamp of the start of the first era.
Number of periods in an era.
Number of seconds in a period.
Number of seconds in an era.
Functions
Calculates the era and period of the given Unix timestamp.
Calculates the start timestamp of an era.
Calculates the next era and period of the given period.
Calculates the next era and period of the given Unix timestamp.
Calculates the start timestamp of a period of an era.
A period is elapsed
if its start time has passed.