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
auseful for computing upper-bounds.
Singleton xrepresents the singleton set{x}
AfterMaxBoundrepresents the set of all values larger than the maximal value that can be represented by typeainstance 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.
Field
Type
Description
holders
[Party]
expiresAt
optContext
Short, human-readable description of the context in which the amulet is locked. Intended for wallets to inform the user about the reason for the lock. Consider what details to share about the context, as that might be private and the string here will be public information.
instance FromAnyValue TimeLock
instance ToAnyValue TimeLock
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 GetField "optContext" TimeLock (Optional Text)
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 -> Optional (BoundedSet Time)
estimateOpenRoundCreatedAt tickDuration currentMiningRound targetRoundestimates creationTimeof a specifiedtargetRoundprovided that one is in the future.
- doesLockExpireBeforeAmulet
: OpenMiningRound -> TimeLock -> ExpiringAmount -> RelTime -> Bool
doesLockExpireBeforeAmuletcomputes whether aTimeLockexpires before aAmulet
- isAmuletExpired
: OpenMiningRound -> ExpiringAmount -> Bool
isAmuletExpired openRound amuletAmountcomputes whether the expiringamuletAmountis definitely expired in case theopenRoundis open.
Comments