cardano-ledger-allegra-1.6.1.0: Allegra ledger era that introduces time lock support.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Allegra.Scripts

Synopsis

Documentation

data Timelock era Source #

Instances

Instances details
Memoized Timelock Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Associated Types

type RawType Timelock = (r ∷ TypeType) Source #

Generic (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Associated Types

type Rep (Timelock era) ∷ TypeType Source #

Methods

fromTimelock era → Rep (Timelock era) x Source #

toRep (Timelock era) x → Timelock era Source #

HashAlgorithm (HASH (EraCrypto era)) ⇒ Show (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

showsPrecIntTimelock era → ShowS Source #

showTimelock era → String Source #

showList ∷ [Timelock era] → ShowS Source #

Typeable era ⇒ ToCBOR (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

toCBORTimelock era → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Timelock era) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Timelock era] → Size Source #

Era era ⇒ DecCBOR (Annotator (Timelock era)) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Era era ⇒ EncCBOR (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

encCBORTimelock era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (Timelock era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Timelock era] → Size Source #

EqRaw (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

eqRawTimelock era → Timelock era → Bool Source #

SafeToHash (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NFData (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

rnfTimelock era → () Source #

Eq (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

(==)Timelock era → Timelock era → Bool Source #

(/=)Timelock era → Timelock era → Bool Source #

Era era ⇒ NoThunks (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type RawType Timelock Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep (Timelock era) = D1 ('MetaData "Timelock" "Cardano.Ledger.Allegra.Scripts" "cardano-ledger-allegra-1.6.1.0-inplace" 'True) (C1 ('MetaCons "TimelockConstr" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MemoBytes TimelockRaw era))))

data TimelockRaw era Source #

Instances

Instances details
Generic (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Associated Types

type Rep (TimelockRaw era) ∷ TypeType Source #

Methods

fromTimelockRaw era → Rep (TimelockRaw era) x Source #

toRep (TimelockRaw era) x → TimelockRaw era Source #

HashAlgorithm (HASH (EraCrypto era)) ⇒ Show (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Era era ⇒ DecCBOR (Annotator (TimelockRaw era)) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Era era ⇒ EncCBOR (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

encCBORTimelockRaw era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (TimelockRaw era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [TimelockRaw era] → Size Source #

NFData (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

rnfTimelockRaw era → () Source #

Eq (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

(==)TimelockRaw era → TimelockRaw era → Bool Source #

(/=)TimelockRaw era → TimelockRaw era → Bool Source #

Era era ⇒ NoThunks (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

inIntervalSlotNoValidityIntervalBool 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)

eqTimelockRawTimelock 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

Instances details
ToJSON ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Generic ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Associated Types

type Rep ValidityIntervalTypeType Source #

Show ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

DecCBOR ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

EncCBOR ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NFData ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

rnfValidityInterval → () Source #

Eq ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Ord ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NoThunks ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep ValidityInterval Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep ValidityInterval = D1 ('MetaData "ValidityInterval" "Cardano.Ledger.Allegra.Scripts" "cardano-ledger-allegra-1.6.1.0-inplace" 'False) (C1 ('MetaCons "ValidityInterval" 'PrefixI 'True) (S1 ('MetaSel ('Just "invalidBefore") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe SlotNo)) :*: S1 ('MetaSel ('Just "invalidHereafter") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe SlotNo))))

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.

Orphan instances

Crypto c ⇒ EraScript (AllegraEra c) Source #

Since Timelock scripts are a strictly backwards compatible extension of MultiSig scripts, we can use the same scriptPrefixTag tag here as we did for the ValidateScript instance in MultiSig

Instance details

Associated Types

type Script (AllegraEra c) = (r ∷ Type) Source #

type NativeScript (AllegraEra c) = (r ∷ Type) Source #

Crypto c ⇒ ShelleyEraScript (AllegraEra c) Source # 
Instance details