cardano-ledger-allegra-1.7.0.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 #

Methods

fromTimelock era → Rep (Timelock era) x #

toRep (Timelock era) x → Timelock era #

Show (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

showsPrecIntTimelock era → ShowS #

showTimelock era → String #

showList ∷ [Timelock era] → ShowS #

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 #

SafeToHash (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

EqRaw (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

eqRawTimelock era → Timelock era → Bool Source #

NFData (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

rnfTimelock era → () #

Eq (Timelock era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

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

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

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

Defined in Cardano.Ledger.Allegra.Scripts

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.7.0.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 #

Methods

fromTimelockRaw era → Rep (TimelockRaw era) x #

toRep (TimelockRaw era) x → TimelockRaw era #

Show (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

showsPrecIntTimelockRaw era → ShowS #

showTimelockRaw era → String #

showList ∷ [TimelockRaw era] → ShowS #

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 → () #

Eq (TimelockRaw era) Source # 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

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

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

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

type Rep (TimelockRaw era) = D1 ('MetaData "TimelockRaw" "Cardano.Ledger.Allegra.Scripts" "cardano-ledger-allegra-1.7.0.0-inplace" 'False) ((C1 ('MetaCons "Signature" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'Witness))) :+: (C1 ('MetaCons "AllOf" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq (Timelock era)))) :+: C1 ('MetaCons "AnyOf" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq (Timelock era)))))) :+: (C1 ('MetaCons "MOfN" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictSeq (Timelock era)))) :+: (C1 ('MetaCons "TimeStart" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :+: C1 ('MetaCons "TimeExpire" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)))))

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 #

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 → () #

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.7.0.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) ⇒ 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