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§
- COMMON_
ERA_ UNIX_ TS - The Unix timestamp of the start of the first era.
- ERA_
NUM_ PERIODS - Number of periods in an era.
- PERIOD_
SECONDS - Number of seconds in a period.
- SECONDS_
PER_ ERA - Number of seconds in an era.
Functions§
- calculate_
era_ and_ period_ of_ ts - Calculates the era and period of the given Unix timestamp.
- calculate_
era_ start_ ts - Calculates the start timestamp of an era.
- calculate_
next_ era_ and_ period - Calculates the next era and period of the given period.
- calculate_
next_ era_ and_ period_ of_ ts - Calculates the next era and period of the given Unix timestamp.
- calculate_
period_ start_ ts - Calculates the start timestamp of a period of an era.
- has_
period_ elapsed - A period is
elapsedif its start time has passed.