cardano-ledger-api-1.11.0.0: Public API for the cardano ledger codebase
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Api.Scripts

Contents

Synopsis

Documentation

class (Era era, Show (Script era), Eq (Script era), EqRaw (Script era), ToCBOR (Script era), EncCBOR (Script era), DecCBOR (Annotator (Script era)), NoThunks (Script era), SafeToHash (Script era), Eq (NativeScript era), Show (NativeScript era), NFData (NativeScript era), NoThunks (NativeScript era), EncCBOR (NativeScript era), DecCBOR (Annotator (NativeScript era))) ⇒ EraScript era Source #

Typeclass for script data types. Allows for script validation and hashing. You must understand the role of SafeToHash and scriptPrefixTag to make new instances. scriptPrefixTag is a magic number representing the tag of the script language. For each new script language defined, a new tag is chosen and the tag is included in the script hash for a script. The safeToHash constraint ensures that Scripts are never reserialised.

Associated Types

type Script era = (r ∷ Type) | r → era Source #

Scripts which may lock transaction outputs in this era

type NativeScript era = (r ∷ Type) | r → era Source #

data ScriptHash Source #

Instances

Instances details
FromJSON ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

FromJSONKey ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSON ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSONKey ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

Generic ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep ScriptHashTypeType Source #

Show ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

FromCBOR ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

ToCBOR ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

toCBORScriptHashEncoding Source #

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

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

DecCBOR ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

EncCBOR ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

encCBORScriptHashEncoding Source #

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

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

NFData ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfScriptHash → () Source #

Eq ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

Ord ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

NoThunks ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep ScriptHash 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep ScriptHash = D1 ('MetaData "ScriptHash" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.17.0.0-inplace" 'True) (C1 ('MetaCons "ScriptHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hash ADDRHASH EraIndependentScript))))

upgradeScriptEraScript era ⇒ Script (PreviousEra era) → Script era Source #

Every era, except Shelley, must be able to upgrade a Script from a previous era.

Warning - Important to note that any memoized binary representation will not be preserved, you need to retain underlying bytes you can use translateEraThroughCBOR

hashScriptEraScript era ⇒ Script era → ScriptHash Source #

Compute ScriptHash of a Script for a particular era.

validateNativeScriptEraTx era ⇒ Tx era → NativeScript era → Bool Source #

Using information from the transaction validate the supplied native script.

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 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Generic ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Associated Types

type Rep ValidityIntervalTypeType Source #

Show ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

DecCBOR ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

EncCBOR ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NFData ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Methods

rnfValidityInterval → () Source #

Eq ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

Ord ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

NoThunks ValidityInterval 
Instance details

Defined in Cardano.Ledger.Allegra.Scripts

type Rep ValidityInterval 
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))))

Alonzo

class (EraScript era, Eq (PlutusScript era), Ord (PlutusScript era), Show (PlutusScript era), NoThunks (PlutusScript era), NFData (PlutusScript era), SafeToHash (PlutusScript era), Eq (PlutusPurpose AsItem era), Show (PlutusPurpose AsItem era), EncCBOR (PlutusPurpose AsItem era), DecCBOR (PlutusPurpose AsItem era), NoThunks (PlutusPurpose AsItem era), NFData (PlutusPurpose AsItem era), Eq (PlutusPurpose AsIx era), Ord (PlutusPurpose AsIx era), Show (PlutusPurpose AsIx era), EncCBOR (PlutusPurpose AsIx era), DecCBOR (PlutusPurpose AsIx era), EncCBORGroup (PlutusPurpose AsIx era), DecCBORGroup (PlutusPurpose AsIx era), NoThunks (PlutusPurpose AsIx era), NFData (PlutusPurpose AsIx era), Eq (PlutusPurpose AsIxItem era), Show (PlutusPurpose AsIxItem era), NoThunks (PlutusPurpose AsIxItem era), NFData (PlutusPurpose AsIxItem era), AllegraEraScript era) ⇒ AlonzoEraScript era where Source #

Associated Types

data PlutusScript era Source #

type PlutusPurpose (f ∷ TypeTypeType) era = (r ∷ Type) | r → era Source #

Instances

Instances details
AlonzoEraScript AlonzoEra 
Instance details

Defined in Cardano.Ledger.Alonzo.Scripts

Associated Types

data PlutusScript AlonzoEra Source #

type PlutusPurpose f AlonzoEra = (r ∷ Type) Source #

pattern CertifyingPurposeAlonzoEraScript era ⇒ f Word32 (TxCert era) → PlutusPurpose f era Source #

data CostModels Source #

For a known version of Plutus, attempting to construct a cost model with too few parameters (depending on the version) will result in an error. CostModelApplyError exists to collect these errors in the CostModels type. The CostModels type itself needs to be flexible enough to accept any map of Word8 to '[Int64]', so that cost models can be placed in the protocol parameters ahead of changes to the Plutus evaluation context. In this way, serializing a cost model, updating software, and deserializing can result in errors going away.

Additionally, CostModels needs to be able to store cost models for future version of Plutus, which we cannot yet even validate. These are stored in costModelsUnknown.

Instances

Instances details
FromJSON CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

ToJSON CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Monoid CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Semigroup CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Generic CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Associated Types

type Rep CostModelsTypeType Source #

Show CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

DecCBOR CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

EncCBOR CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Methods

encCBORCostModelsEncoding Source #

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

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

NFData CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Methods

rnfCostModels → () Source #

Eq CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

Ord CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

NoThunks CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

type Rep CostModels 
Instance details

Defined in Cardano.Ledger.Plutus.CostModels

type Rep CostModels = D1 ('MetaData "CostModels" "Cardano.Ledger.Plutus.CostModels" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "CostModels" 'PrefixI 'True) (S1 ('MetaSel ('Just "_costModelsValid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Language CostModel)) :*: S1 ('MetaSel ('Just "_costModelsUnknown") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Word8 [Int64]))))

Conway