Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Ledger.ShelleyMA.Timelocks
Synopsis
-
data
Timelock
crypto
where
- pattern RequireSignature :: Crypto crypto => KeyHash ' Witness crypto -> Timelock crypto
- pattern RequireAllOf :: Crypto crypto => StrictSeq ( Timelock crypto) -> Timelock crypto
- pattern RequireAnyOf :: Crypto crypto => StrictSeq ( Timelock crypto) -> Timelock crypto
- pattern RequireMOf :: Crypto crypto => Int -> StrictSeq ( Timelock crypto) -> Timelock crypto
- pattern RequireTimeExpire :: Crypto crypto => SlotNo -> Timelock crypto
- pattern RequireTimeStart :: Crypto crypto => SlotNo -> Timelock crypto
- pattern TimelockConstr :: MemoBytes (TimelockRaw crypto) -> Timelock crypto
- inInterval :: SlotNo -> ValidityInterval -> Bool
- showTimelock :: Crypto crypto => Timelock crypto -> String
- evalTimelock :: Crypto crypto => Set ( KeyHash ' Witness crypto) -> ValidityInterval -> Timelock crypto -> Bool
- validateTimelock :: forall era. ( UsesTxBody era, HasField "vldt" ( TxBody era) ValidityInterval , HasField "addrWits" ( Tx era) ( Set ( WitVKey ' Witness ( Crypto era)))) => Timelock ( Crypto era) -> Tx era -> Bool
-
data
ValidityInterval
=
ValidityInterval
{
- invalidBefore :: !( StrictMaybe SlotNo )
- invalidHereafter :: !( StrictMaybe SlotNo )
- encodeVI :: ValidityInterval -> Encode (' Closed ' Dense ) ValidityInterval
- decodeVI :: Decode (' Closed ' Dense ) ValidityInterval
- translate :: Crypto crypto => MultiSig crypto -> Timelock crypto
Documentation
data Timelock crypto where Source #
Bundled Patterns
pattern RequireSignature :: Crypto crypto => KeyHash ' Witness crypto -> Timelock crypto | |
pattern RequireAllOf :: Crypto crypto => StrictSeq ( Timelock crypto) -> Timelock crypto | |
pattern RequireAnyOf :: Crypto crypto => StrictSeq ( Timelock crypto) -> Timelock crypto | |
pattern RequireMOf :: Crypto crypto => Int -> StrictSeq ( Timelock crypto) -> Timelock crypto | |
pattern RequireTimeExpire :: Crypto crypto => SlotNo -> Timelock crypto | |
pattern RequireTimeStart :: Crypto crypto => SlotNo -> Timelock crypto |
Instances
pattern TimelockConstr :: MemoBytes (TimelockRaw crypto) -> Timelock crypto Source #
inInterval :: SlotNo -> ValidityInterval -> Bool Source #
Test if a slot is in the Validity interval. Recall that a ValidityInterval is a half Open interval, that is why we use (slot < top)
evalTimelock :: Crypto crypto => Set ( KeyHash ' Witness crypto) -> ValidityInterval -> Timelock crypto -> Bool Source #
validateTimelock :: forall era. ( UsesTxBody era, HasField "vldt" ( TxBody era) ValidityInterval , HasField "addrWits" ( Tx era) ( Set ( WitVKey ' Witness ( Crypto era)))) => Timelock ( Crypto era) -> Tx era -> Bool Source #
data ValidityInterval Source #
ValidityInterval is a half open interval. Closed on the bottom, Open on the top. A SNothing on the bottom is negative infinity, and a SNothing on the top is positive infinity
Constructors
ValidityInterval | |
Fields
|
Instances
encodeVI :: ValidityInterval -> Encode (' Closed ' Dense ) ValidityInterval Source #