Splice.Expiry
Functions for computing amulet and lock expiry times and conditions.
Data Types
data BoundedSet a
A symbolic representation of a set of values of type
a
useful for computing upper-bounds.
Singleton x
represents the singleton set{x}
AfterMaxBound
represents the set of all values larger than the maximal value that can be represented by typea
instance Functor BoundedSet
instance Eq a => Eq (BoundedSet a)
instance Show a => Show (BoundedSet a)
data TimeLock
A lock held by multiple parties until its expiry.
instance GetField "expiresAt" TimeLock Time
instance GetField "holders" TimeLock [Party]
instance GetField "lock" LockedAmulet TimeLock
instance GetField "lock" PreprocessedTransferOutput (Optional TimeLock)
instance GetField "lock" TransferOutput (Optional TimeLock)
instance SetField "expiresAt" TimeLock Time
instance SetField "holders" TimeLock [Party]
instance SetField "lock" LockedAmulet TimeLock
instance SetField "lock" PreprocessedTransferOutput (Optional TimeLock)
instance SetField "lock" TransferOutput (Optional TimeLock)
Functions
- amountExpiresAt
: ExpiringAmount -> BoundedSet Round
Compute the round where the amulet expires. i.e. the amulet is fully expired.
- estimateOpenRoundCreatedAt
: RelTime -> OpenMiningRound -> BoundedSet Round -> BoundedSet Time
estimateOpenRoundCreatedAt tickDuration currentMiningRound targetRound
estimates creationTime
of a specifiedtargetRound
.
- doesLockExpireBeforeAmulet
: OpenMiningRound -> TimeLock -> ExpiringAmount -> RelTime -> Bool
doesLockExpireBeforeAmulet
computes whether aTimeLock
expires before aAmulet
- isAmuletExpired
: OpenMiningRound -> ExpiringAmount -> Bool
isAmuletExpired openRound amuletAmount
computes whether the expiringamuletAmount
is definitely expired in case theopenRound
is open.