Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype ContestationPeriod = UnsafeContestationPeriod Natural
- fromNominalDiffTime :: MonadFail m => NominalDiffTime -> m ContestationPeriod
- toNominalDiffTime :: ContestationPeriod -> NominalDiffTime
- toChain :: ContestationPeriod -> ContestationPeriod
- fromChain :: ContestationPeriod -> ContestationPeriod
Documentation
newtype ContestationPeriod Source #
A positive, non-zero number of seconds.
Instances
fromNominalDiffTime :: MonadFail m => NominalDiffTime -> m ContestationPeriod Source #
Create a ContestationPeriod
from a NominalDiffTime
. This will fail if a
negative NominalDiffTime is provided and truncates to 1s if values < 1s are given.
toChain :: ContestationPeriod -> ContestationPeriod Source #
Convert an off-chain contestation period to its on-chain representation.
fromChain :: ContestationPeriod -> ContestationPeriod Source #
Convert an on-chain contestation period to its off-chain representation. NOTE: Does truncate to whole seconds.