VoteTiming

init(struct VoteTiming.Data data, uint256 phaseLength) internal

Initializes the data object. Sets the phase length based on the input and resets the round id and round start time to 1 and 0 respectively.

This method should generally only be run once, but it can also be used to reset the data structure to its initial values.

getLastUpdatedRoundId(struct VoteTiming.Data data) → uint256 internal

Gets the most recently stored round ID set by updateRoundId().

shouldUpdateRoundId(struct VoteTiming.Data data, uint256 currentTime) → bool internal

Determines whether time has advanced far enough to advance to the next voting round and update the stored round id.

updateRoundId(struct VoteTiming.Data data, uint256 currentTime) internal

Updates the round id. Note: if shouldUpdateRoundId() returns false, this method will have no effect.

computeCurrentRoundId(struct VoteTiming.Data data, uint256 currentTime) → uint256 roundId internal

Computes what the stored round id would be if it were updated right now, but this method does not commit the update.

computeCurrentPhase(struct VoteTiming.Data data, uint256 currentTime) → enum VoteTiming.Phase internal

Computes the current phase based only on the current time.

computeEstimatedRoundEndTime(struct VoteTiming.Data data, uint256 roundId) → uint256 internal

Gets the end time of the current round or any round in the future. Note: this method will revert if the roundId < getLastUpdatedRoundId().

© UMA Project 2018-2019