Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class ShelleyEraScript era ⇒ AllegraEraScript era where
- mkTimeStart ∷ SlotNo → NativeScript era
- getTimeStart ∷ NativeScript era → Maybe SlotNo
- mkTimeExpire ∷ SlotNo → NativeScript era
- getTimeExpire ∷ NativeScript era → Maybe SlotNo
- mkRequireSignatureTimelock ∷ Era era ⇒ KeyHash 'Witness (EraCrypto era) → Timelock era
- getRequireSignatureTimelock ∷ Era era ⇒ Timelock era → Maybe (KeyHash 'Witness (EraCrypto era))
- mkRequireAllOfTimelock ∷ Era era ⇒ StrictSeq (Timelock era) → Timelock era
- getRequireAllOfTimelock ∷ Era era ⇒ Timelock era → Maybe (StrictSeq (Timelock era))
- mkRequireAnyOfTimelock ∷ Era era ⇒ StrictSeq (Timelock era) → Timelock era
- getRequireAnyOfTimelock ∷ Era era ⇒ Timelock era → Maybe (StrictSeq (Timelock era))
- mkRequireMOfTimelock ∷ Era era ⇒ Int → StrictSeq (Timelock era) → Timelock era
- getRequireMOfTimelock ∷ Era era ⇒ Timelock era → Maybe (Int, StrictSeq (Timelock era))
- mkTimeStartTimelock ∷ Era era ⇒ SlotNo → Timelock era
- getTimeStartTimelock ∷ Era era ⇒ Timelock era → Maybe SlotNo
- mkTimeExpireTimelock ∷ Era era ⇒ SlotNo → Timelock era
- getTimeExpireTimelock ∷ Era era ⇒ Timelock era → Maybe SlotNo
- data Timelock era
- pattern RequireTimeExpire ∷ AllegraEraScript era ⇒ SlotNo → NativeScript era
- pattern RequireTimeStart ∷ AllegraEraScript era ⇒ SlotNo → NativeScript era
- data TimelockRaw era
- pattern TimelockConstr ∷ MemoBytes TimelockRaw era → Timelock era
- inInterval ∷ SlotNo → ValidityInterval → Bool
- showTimelock ∷ AllegraEraScript era ⇒ NativeScript era → String
- evalTimelock ∷ AllegraEraScript era ⇒ Set (KeyHash 'Witness (EraCrypto era)) → ValidityInterval → NativeScript era → Bool
- eqTimelockRaw ∷ Timelock era → Timelock era → Bool
- data ValidityInterval = ValidityInterval {}
- encodeVI ∷ ValidityInterval → Encode ('Closed 'Dense) ValidityInterval
- decodeVI ∷ Decode ('Closed 'Dense) ValidityInterval
- translateTimelock ∷ ∀ era1 era2. (Era era1, Era era2, EraCrypto era1 ~ EraCrypto era2) ⇒ Timelock era1 → Timelock era2
Documentation
class ShelleyEraScript era ⇒ AllegraEraScript era where Source #
mkTimeStart ∷ SlotNo → NativeScript era Source #
getTimeStart ∷ NativeScript era → Maybe SlotNo Source #
mkTimeExpire ∷ SlotNo → NativeScript era Source #
getTimeExpire ∷ NativeScript era → Maybe SlotNo Source #
Instances
Crypto c ⇒ AllegraEraScript (AllegraEra c) Source # | |
Defined in Cardano.Ledger.Allegra.Scripts mkTimeStart ∷ SlotNo → NativeScript (AllegraEra c) Source # getTimeStart ∷ NativeScript (AllegraEra c) → Maybe SlotNo Source # mkTimeExpire ∷ SlotNo → NativeScript (AllegraEra c) Source # getTimeExpire ∷ NativeScript (AllegraEra c) → Maybe SlotNo Source # |
getRequireSignatureTimelock ∷ Era era ⇒ Timelock era → Maybe (KeyHash 'Witness (EraCrypto era)) Source #
Instances
pattern RequireTimeExpire ∷ AllegraEraScript era ⇒ SlotNo → NativeScript era Source #
pattern RequireTimeStart ∷ AllegraEraScript era ⇒ SlotNo → NativeScript era Source #
data TimelockRaw era Source #
Instances
pattern TimelockConstr ∷ MemoBytes TimelockRaw era → Timelock era 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)
showTimelock ∷ AllegraEraScript era ⇒ NativeScript era → String Source #
evalTimelock ∷ AllegraEraScript era ⇒ Set (KeyHash 'Witness (EraCrypto era)) → ValidityInterval → NativeScript era → Bool Source #
eqTimelockRaw ∷ Timelock era → Timelock era → Bool Source #
Check the equality of two underlying types, while ignoring their binary
representation, which Eq
instance normally does. This is used for testing.
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
Instances
translateTimelock ∷ ∀ era1 era2. (Era era1, Era era2, EraCrypto era1 ~ EraCrypto era2) ⇒ Timelock era1 → Timelock era2 Source #
This function deconstructs and then reconstructs the timelock script to prove the compiler that we can arbirarily switch out the eras as long as the cryptos for both eras are the same.