| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Api.Scripts
Synopsis
- module Cardano.Ledger.Api.Scripts.Data
- 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), ToCBOR (NativeScript era), EncCBOR (NativeScript era), DecCBOR (Annotator (NativeScript era))) ⇒ EraScript era where
- type Script era = (r ∷ Type) | r → era
- type NativeScript era = (r ∷ Type) | r → era
- data ScriptHash
- scriptPrefixTag ∷ EraScript era ⇒ Script era → ByteString
- upgradeScript ∷ EraScript era ⇒ Script (PreviousEra era) → Script era
- hashScript ∷ EraScript era ⇒ Script era → ScriptHash
- getNativeScript ∷ EraScript era ⇒ Script era → Maybe (NativeScript era)
- validateNativeScript ∷ ∀ (l ∷ TxLevel). EraTx era ⇒ Tx l era → NativeScript era → Bool
- isNativeScript ∷ EraScript era ⇒ Script era → Bool
- data ValidityInterval = ValidityInterval {}
- class EraScript era ⇒ AnyEraScript era where
- anyEraMaxLanguage ∷ Maybe Language
- anyEraToPlutusScript ∷ Script era → Maybe (PlutusScript era)
- anyEraToSpendingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 TxIn)
- anyEraToMintingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 PolicyID)
- anyEraToCertifyingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (TxCert era))
- anyEraToRewardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 RewardAccount)
- anyEraToVotingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 Voter)
- anyEraToProposingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (ProposalProcedure era))
- anyEraToGuardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 ScriptHash)
- pattern AnyEraSpendingPurpose ∷ AnyEraScript era ⇒ f Word32 TxIn → PlutusPurpose f era
- pattern AnyEraMintingPurpose ∷ AnyEraScript era ⇒ f Word32 PolicyID → PlutusPurpose f era
- pattern AnyEraCertifyingPurpose ∷ AnyEraScript era ⇒ f Word32 (TxCert era) → PlutusPurpose f era
- pattern AnyEraRewardingPurpose ∷ AnyEraScript era ⇒ f Word32 RewardAccount → PlutusPurpose f era
- pattern AnyEraVotingPurpose ∷ AnyEraScript era ⇒ f Word32 Voter → PlutusPurpose f era
- pattern AnyEraProposingPurpose ∷ AnyEraScript era ⇒ f Word32 (ProposalProcedure era) → PlutusPurpose f era
- pattern AnyEraGuardingPurpose ∷ AnyEraScript era ⇒ f Word32 ScriptHash → PlutusPurpose f era
- 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
- data PlutusScript era
- type PlutusPurpose (f ∷ Type → Type → Type) era = (r ∷ Type) | r → era
- toSpendingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 TxIn)
- toMintingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 PolicyID)
- toCertifyingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (TxCert era))
- toRewardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 RewardAccount)
- isPlutusScript ∷ AlonzoEraScript era ⇒ Script era → Bool
- pattern SpendingPurpose ∷ AlonzoEraScript era ⇒ f Word32 TxIn → PlutusPurpose f era
- pattern MintingPurpose ∷ AlonzoEraScript era ⇒ f Word32 PolicyID → PlutusPurpose f era
- pattern CertifyingPurpose ∷ AlonzoEraScript era ⇒ f Word32 (TxCert era) → PlutusPurpose f era
- pattern RewardingPurpose ∷ AlonzoEraScript era ⇒ f Word32 RewardAccount → PlutusPurpose f era
- data CostModels
- class AlonzoEraScript era ⇒ ConwayEraScript era where
- toVotingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 Voter)
- toProposingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (ProposalProcedure era))
- pattern VotingPurpose ∷ ConwayEraScript era ⇒ f Word32 Voter → PlutusPurpose f era
- pattern ProposingPurpose ∷ ConwayEraScript era ⇒ f Word32 (ProposalProcedure era) → PlutusPurpose f era
- class ConwayEraScript era ⇒ DijkstraEraScript era where
- toGuardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 ScriptHash)
- pattern GuardingPurpose ∷ DijkstraEraScript era ⇒ f Word32 ScriptHash → PlutusPurpose f era
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), ToCBOR (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.
Minimal complete definition
upgradeScript, scriptPrefixTag, getNativeScript, fromNativeScript
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 #
Instances
data ScriptHash Source #
Instances
| FromJSON ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods parseJSON ∷ Value → Parser ScriptHash Source # parseJSONList ∷ Value → Parser [ScriptHash] Source # | |||||
| FromJSONKey ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| ToJSON ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods toJSON ∷ ScriptHash → Value Source # toEncoding ∷ ScriptHash → Encoding Source # toJSONList ∷ [ScriptHash] → Value Source # toEncodingList ∷ [ScriptHash] → Encoding Source # omitField ∷ ScriptHash → Bool Source # | |||||
| ToJSONKey ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| FromCBOR ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| ToCBOR ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods toCBOR ∷ ScriptHash → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ScriptHash → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ScriptHash] → Size Source # | |||||
| DecCBOR ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| EncCBOR ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods encCBOR ∷ ScriptHash → Encoding Source # | |||||
| NFData ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods rnf ∷ ScriptHash → () # | |||||
| Generic ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Associated Types
| |||||
| Show ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods showsPrec ∷ Int → ScriptHash → ShowS # show ∷ ScriptHash → String # showList ∷ [ScriptHash] → ShowS # | |||||
| Eq ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| Ord ScriptHash | |||||
Defined in Cardano.Ledger.Hashes Methods compare ∷ ScriptHash → ScriptHash → Ordering # (<) ∷ ScriptHash → ScriptHash → Bool # (<=) ∷ ScriptHash → ScriptHash → Bool # (>) ∷ ScriptHash → ScriptHash → Bool # (>=) ∷ ScriptHash → ScriptHash → Bool # max ∷ ScriptHash → ScriptHash → ScriptHash # min ∷ ScriptHash → ScriptHash → ScriptHash # | |||||
| MemPack ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| NoThunks ScriptHash | |||||
Defined in Cardano.Ledger.Hashes | |||||
| Indexable ScriptHash GuardsScriptHashView | |||||
Defined in Cardano.Ledger.Dijkstra.TxBody Methods indexOf ∷ AsItem Word32 ScriptHash → GuardsScriptHashView → StrictMaybe (AsIx Word32 ScriptHash) Source # fromIndex ∷ AsIx Word32 ScriptHash → GuardsScriptHashView → StrictMaybe (AsIxItem Word32 ScriptHash) Source # | |||||
| type Rep ScriptHash | |||||
Defined in Cardano.Ledger.Hashes type Rep ScriptHash = D1 ('MetaData "ScriptHash" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "ScriptHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hash ADDRHASH EraIndependentScript)))) | |||||
scriptPrefixTag ∷ EraScript era ⇒ Script era → ByteString Source #
upgradeScript ∷ EraScript 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. If you need to retain underlying bytes then you can use translateEraThroughCBOR
hashScript ∷ EraScript era ⇒ Script era → ScriptHash Source #
Compute ScriptHash of a Script for a particular era.
getNativeScript ∷ EraScript era ⇒ Script era → Maybe (NativeScript era) Source #
validateNativeScript ∷ ∀ (l ∷ TxLevel). EraTx era ⇒ Tx l 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
Constructors
| ValidityInterval | |
Fields | |
Instances
| ToJSON ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Methods toJSON ∷ ValidityInterval → Value Source # toEncoding ∷ ValidityInterval → Encoding Source # toJSONList ∷ [ValidityInterval] → Value Source # | |||||
| DecCBOR ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts | |||||
| EncCBOR ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Methods | |||||
| NFData ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Methods rnf ∷ ValidityInterval → () # | |||||
| Generic ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Associated Types
Methods from ∷ ValidityInterval → Rep ValidityInterval x # to ∷ Rep ValidityInterval x → ValidityInterval # | |||||
| Show ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Methods showsPrec ∷ Int → ValidityInterval → ShowS # show ∷ ValidityInterval → String # showList ∷ [ValidityInterval] → ShowS # | |||||
| Eq ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Methods | |||||
| Ord ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts Methods compare ∷ ValidityInterval → ValidityInterval → Ordering # (<) ∷ ValidityInterval → ValidityInterval → Bool # (<=) ∷ ValidityInterval → ValidityInterval → Bool # (>) ∷ ValidityInterval → ValidityInterval → Bool # (>=) ∷ ValidityInterval → ValidityInterval → Bool # max ∷ ValidityInterval → ValidityInterval → ValidityInterval # min ∷ ValidityInterval → ValidityInterval → ValidityInterval # | |||||
| NoThunks ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts | |||||
| type Rep ValidityInterval | |||||
Defined in Cardano.Ledger.Allegra.Scripts type Rep ValidityInterval = D1 ('MetaData "ValidityInterval" "Cardano.Ledger.Allegra.Scripts" "cardano-ledger-allegra-1.9.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)))) | |||||
Any era
class EraScript era ⇒ AnyEraScript era where Source #
Minimal complete definition
Nothing
Methods
anyEraMaxLanguage ∷ Maybe Language Source #
default anyEraMaxLanguage ∷ AlonzoEraScript era ⇒ Maybe Language Source #
anyEraToPlutusScript ∷ Script era → Maybe (PlutusScript era) Source #
default anyEraToPlutusScript ∷ AlonzoEraScript era ⇒ Script era → Maybe (PlutusScript era) Source #
anyEraToSpendingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 TxIn) Source #
default anyEraToSpendingPurpose ∷ AlonzoEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 TxIn) Source #
anyEraToMintingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 PolicyID) Source #
default anyEraToMintingPurpose ∷ AlonzoEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 PolicyID) Source #
anyEraToCertifyingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (TxCert era)) Source #
default anyEraToCertifyingPurpose ∷ AlonzoEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 (TxCert era)) Source #
anyEraToRewardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 RewardAccount) Source #
default anyEraToRewardingPurpose ∷ AlonzoEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 RewardAccount) Source #
anyEraToVotingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 Voter) Source #
default anyEraToVotingPurpose ∷ ConwayEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 Voter) Source #
anyEraToProposingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (ProposalProcedure era)) Source #
default anyEraToProposingPurpose ∷ ConwayEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 (ProposalProcedure era)) Source #
anyEraToGuardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 ScriptHash) Source #
default anyEraToGuardingPurpose ∷ DijkstraEraScript era ⇒ PlutusPurpose f era → Maybe (f Word32 ScriptHash) Source #
Instances
| AnyEraScript AllegraEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script AllegraEra → Maybe (PlutusScript AllegraEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 (TxCert AllegraEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 (ProposalProcedure AllegraEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f AllegraEra → Maybe (f Word32 ScriptHash) Source # | |
| AnyEraScript AlonzoEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script AlonzoEra → Maybe (PlutusScript AlonzoEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 (TxCert AlonzoEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 (ProposalProcedure AlonzoEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 ScriptHash) Source # | |
| AnyEraScript BabbageEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script BabbageEra → Maybe (PlutusScript BabbageEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 (TxCert BabbageEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 (ProposalProcedure BabbageEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 ScriptHash) Source # | |
| AnyEraScript ConwayEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script ConwayEra → Maybe (PlutusScript ConwayEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 (TxCert ConwayEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 (ProposalProcedure ConwayEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 ScriptHash) Source # | |
| AnyEraScript DijkstraEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script DijkstraEra → Maybe (PlutusScript DijkstraEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 (TxCert DijkstraEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 (ProposalProcedure DijkstraEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 ScriptHash) Source # | |
| AnyEraScript MaryEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script MaryEra → Maybe (PlutusScript MaryEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 (TxCert MaryEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 (ProposalProcedure MaryEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f MaryEra → Maybe (f Word32 ScriptHash) Source # | |
| AnyEraScript ShelleyEra Source # | |
Defined in Cardano.Ledger.Api.Scripts Methods anyEraMaxLanguage ∷ Maybe Language Source # anyEraToPlutusScript ∷ Script ShelleyEra → Maybe (PlutusScript ShelleyEra) Source # anyEraToSpendingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 TxIn) Source # anyEraToMintingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 PolicyID) Source # anyEraToCertifyingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 (TxCert ShelleyEra)) Source # anyEraToRewardingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 RewardAccount) Source # anyEraToVotingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 Voter) Source # anyEraToProposingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 (ProposalProcedure ShelleyEra)) Source # anyEraToGuardingPurpose ∷ PlutusPurpose f ShelleyEra → Maybe (f Word32 ScriptHash) Source # | |
pattern AnyEraSpendingPurpose ∷ AnyEraScript era ⇒ f Word32 TxIn → PlutusPurpose f era Source #
pattern AnyEraMintingPurpose ∷ AnyEraScript era ⇒ f Word32 PolicyID → PlutusPurpose f era Source #
pattern AnyEraCertifyingPurpose ∷ AnyEraScript era ⇒ f Word32 (TxCert era) → PlutusPurpose f era Source #
pattern AnyEraRewardingPurpose ∷ AnyEraScript era ⇒ f Word32 RewardAccount → PlutusPurpose f era Source #
pattern AnyEraVotingPurpose ∷ AnyEraScript era ⇒ f Word32 Voter → PlutusPurpose f era Source #
pattern AnyEraProposingPurpose ∷ AnyEraScript era ⇒ f Word32 (ProposalProcedure era) → PlutusPurpose f era Source #
pattern AnyEraGuardingPurpose ∷ AnyEraScript era ⇒ f Word32 ScriptHash → PlutusPurpose f era Source #
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 #
Minimal complete definition
eraMaxLanguage, mkPlutusScript, withPlutusScript, hoistPlutusPurpose, mkSpendingPurpose, toSpendingPurpose, mkMintingPurpose, toMintingPurpose, mkCertifyingPurpose, toCertifyingPurpose, mkRewardingPurpose, toRewardingPurpose, upgradePlutusPurposeAsIx
Associated Types
data PlutusScript era Source #
type PlutusPurpose (f ∷ Type → Type → Type) era = (r ∷ Type) | r → era Source #
Methods
toSpendingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 TxIn) Source #
toMintingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 PolicyID) Source #
toCertifyingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (TxCert era)) Source #
toRewardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 RewardAccount) Source #
Instances
| AlonzoEraScript AlonzoEra | |||||||||
Defined in Cardano.Ledger.Alonzo.Scripts Associated Types
Methods eraMaxLanguage ∷ Language Source # toPlutusScript ∷ Script AlonzoEra → Maybe (PlutusScript AlonzoEra) Source # fromPlutusScript ∷ PlutusScript AlonzoEra → Script AlonzoEra Source # mkPlutusScript ∷ ∀ (l ∷ Language) m. (PlutusLanguage l, MonadFail m) ⇒ Plutus l → m (PlutusScript AlonzoEra) Source # withPlutusScript ∷ PlutusScript AlonzoEra → (∀ (l ∷ Language). PlutusLanguage l ⇒ Plutus l → a) → a Source # hoistPlutusPurpose ∷ (∀ ix it. g ix it → f ix it) → PlutusPurpose g AlonzoEra → PlutusPurpose f AlonzoEra Source # mkSpendingPurpose ∷ f Word32 TxIn → PlutusPurpose f AlonzoEra Source # toSpendingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 TxIn) Source # mkMintingPurpose ∷ f Word32 PolicyID → PlutusPurpose f AlonzoEra Source # toMintingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 PolicyID) Source # mkCertifyingPurpose ∷ f Word32 (TxCert AlonzoEra) → PlutusPurpose f AlonzoEra Source # toCertifyingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 (TxCert AlonzoEra)) Source # mkRewardingPurpose ∷ f Word32 RewardAccount → PlutusPurpose f AlonzoEra Source # toRewardingPurpose ∷ PlutusPurpose f AlonzoEra → Maybe (f Word32 RewardAccount) Source # upgradePlutusPurposeAsIx ∷ PlutusPurpose AsIx (PreviousEra AlonzoEra) → PlutusPurpose AsIx AlonzoEra Source # | |||||||||
| AlonzoEraScript BabbageEra | |||||||||
Defined in Cardano.Ledger.Babbage.Scripts Associated Types
Methods eraMaxLanguage ∷ Language Source # toPlutusScript ∷ Script BabbageEra → Maybe (PlutusScript BabbageEra) Source # fromPlutusScript ∷ PlutusScript BabbageEra → Script BabbageEra Source # mkPlutusScript ∷ ∀ (l ∷ Language) m. (PlutusLanguage l, MonadFail m) ⇒ Plutus l → m (PlutusScript BabbageEra) Source # withPlutusScript ∷ PlutusScript BabbageEra → (∀ (l ∷ Language). PlutusLanguage l ⇒ Plutus l → a) → a Source # hoistPlutusPurpose ∷ (∀ ix it. g ix it → f ix it) → PlutusPurpose g BabbageEra → PlutusPurpose f BabbageEra Source # mkSpendingPurpose ∷ f Word32 TxIn → PlutusPurpose f BabbageEra Source # toSpendingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 TxIn) Source # mkMintingPurpose ∷ f Word32 PolicyID → PlutusPurpose f BabbageEra Source # toMintingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 PolicyID) Source # mkCertifyingPurpose ∷ f Word32 (TxCert BabbageEra) → PlutusPurpose f BabbageEra Source # toCertifyingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 (TxCert BabbageEra)) Source # mkRewardingPurpose ∷ f Word32 RewardAccount → PlutusPurpose f BabbageEra Source # toRewardingPurpose ∷ PlutusPurpose f BabbageEra → Maybe (f Word32 RewardAccount) Source # upgradePlutusPurposeAsIx ∷ PlutusPurpose AsIx (PreviousEra BabbageEra) → PlutusPurpose AsIx BabbageEra Source # | |||||||||
| AlonzoEraScript ConwayEra | |||||||||
Defined in Cardano.Ledger.Conway.Scripts Associated Types
Methods eraMaxLanguage ∷ Language Source # toPlutusScript ∷ Script ConwayEra → Maybe (PlutusScript ConwayEra) Source # fromPlutusScript ∷ PlutusScript ConwayEra → Script ConwayEra Source # mkPlutusScript ∷ ∀ (l ∷ Language) m. (PlutusLanguage l, MonadFail m) ⇒ Plutus l → m (PlutusScript ConwayEra) Source # withPlutusScript ∷ PlutusScript ConwayEra → (∀ (l ∷ Language). PlutusLanguage l ⇒ Plutus l → a) → a Source # hoistPlutusPurpose ∷ (∀ ix it. g ix it → f ix it) → PlutusPurpose g ConwayEra → PlutusPurpose f ConwayEra Source # mkSpendingPurpose ∷ f Word32 TxIn → PlutusPurpose f ConwayEra Source # toSpendingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 TxIn) Source # mkMintingPurpose ∷ f Word32 PolicyID → PlutusPurpose f ConwayEra Source # toMintingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 PolicyID) Source # mkCertifyingPurpose ∷ f Word32 (TxCert ConwayEra) → PlutusPurpose f ConwayEra Source # toCertifyingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 (TxCert ConwayEra)) Source # mkRewardingPurpose ∷ f Word32 RewardAccount → PlutusPurpose f ConwayEra Source # toRewardingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 RewardAccount) Source # upgradePlutusPurposeAsIx ∷ PlutusPurpose AsIx (PreviousEra ConwayEra) → PlutusPurpose AsIx ConwayEra Source # | |||||||||
| AlonzoEraScript DijkstraEra | |||||||||
Defined in Cardano.Ledger.Dijkstra.Scripts Associated Types
Methods eraMaxLanguage ∷ Language Source # toPlutusScript ∷ Script DijkstraEra → Maybe (PlutusScript DijkstraEra) Source # fromPlutusScript ∷ PlutusScript DijkstraEra → Script DijkstraEra Source # mkPlutusScript ∷ ∀ (l ∷ Language) m. (PlutusLanguage l, MonadFail m) ⇒ Plutus l → m (PlutusScript DijkstraEra) Source # withPlutusScript ∷ PlutusScript DijkstraEra → (∀ (l ∷ Language). PlutusLanguage l ⇒ Plutus l → a) → a Source # hoistPlutusPurpose ∷ (∀ ix it. g ix it → f ix it) → PlutusPurpose g DijkstraEra → PlutusPurpose f DijkstraEra Source # mkSpendingPurpose ∷ f Word32 TxIn → PlutusPurpose f DijkstraEra Source # toSpendingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 TxIn) Source # mkMintingPurpose ∷ f Word32 PolicyID → PlutusPurpose f DijkstraEra Source # toMintingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 PolicyID) Source # mkCertifyingPurpose ∷ f Word32 (TxCert DijkstraEra) → PlutusPurpose f DijkstraEra Source # toCertifyingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 (TxCert DijkstraEra)) Source # mkRewardingPurpose ∷ f Word32 RewardAccount → PlutusPurpose f DijkstraEra Source # toRewardingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 RewardAccount) Source # upgradePlutusPurposeAsIx ∷ PlutusPurpose AsIx (PreviousEra DijkstraEra) → PlutusPurpose AsIx DijkstraEra Source # | |||||||||
isPlutusScript ∷ AlonzoEraScript era ⇒ Script era → Bool Source #
pattern SpendingPurpose ∷ AlonzoEraScript era ⇒ f Word32 TxIn → PlutusPurpose f era Source #
pattern MintingPurpose ∷ AlonzoEraScript era ⇒ f Word32 PolicyID → PlutusPurpose f era Source #
pattern CertifyingPurpose ∷ AlonzoEraScript era ⇒ f Word32 (TxCert era) → PlutusPurpose f era Source #
pattern RewardingPurpose ∷ AlonzoEraScript era ⇒ f Word32 RewardAccount → 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
| FromJSON CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods parseJSON ∷ Value → Parser CostModels Source # parseJSONList ∷ Value → Parser [CostModels] Source # | |||||
| ToJSON CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods toJSON ∷ CostModels → Value Source # toEncoding ∷ CostModels → Encoding Source # toJSONList ∷ [CostModels] → Value Source # toEncodingList ∷ [CostModels] → Encoding Source # omitField ∷ CostModels → Bool Source # | |||||
| DecCBOR CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels | |||||
| EncCBOR CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods encCBOR ∷ CostModels → Encoding Source # | |||||
| ToPlutusData CostModels | |||||
Defined in Cardano.Ledger.Plutus.ToPlutusData | |||||
| NFData CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods rnf ∷ CostModels → () # | |||||
| Monoid CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels | |||||
| Semigroup CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods (<>) ∷ CostModels → CostModels → CostModels # sconcat ∷ NonEmpty CostModels → CostModels # stimes ∷ Integral b ⇒ b → CostModels → CostModels # | |||||
| Generic CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Associated Types
| |||||
| Show CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods showsPrec ∷ Int → CostModels → ShowS # show ∷ CostModels → String # showList ∷ [CostModels] → ShowS # | |||||
| Eq CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels | |||||
| Ord CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels Methods compare ∷ CostModels → CostModels → Ordering # (<) ∷ CostModels → CostModels → Bool # (<=) ∷ CostModels → CostModels → Bool # (>) ∷ CostModels → CostModels → Bool # (>=) ∷ CostModels → CostModels → Bool # max ∷ CostModels → CostModels → CostModels # min ∷ CostModels → CostModels → CostModels # | |||||
| NoThunks CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels | |||||
| type Rep CostModels | |||||
Defined in Cardano.Ledger.Plutus.CostModels type Rep CostModels = D1 ('MetaData "CostModels" "Cardano.Ledger.Plutus.CostModels" "cardano-ledger-core-1.19.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
class AlonzoEraScript era ⇒ ConwayEraScript era where Source #
Minimal complete definition
mkVotingPurpose, toVotingPurpose, mkProposingPurpose, toProposingPurpose
Methods
toVotingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 Voter) Source #
toProposingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 (ProposalProcedure era)) Source #
Instances
| ConwayEraScript ConwayEra | |
Defined in Cardano.Ledger.Conway.Scripts Methods mkVotingPurpose ∷ f Word32 Voter → PlutusPurpose f ConwayEra Source # toVotingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 Voter) Source # mkProposingPurpose ∷ f Word32 (ProposalProcedure ConwayEra) → PlutusPurpose f ConwayEra Source # toProposingPurpose ∷ PlutusPurpose f ConwayEra → Maybe (f Word32 (ProposalProcedure ConwayEra)) Source # | |
| ConwayEraScript DijkstraEra | |
Defined in Cardano.Ledger.Dijkstra.Scripts Methods mkVotingPurpose ∷ f Word32 Voter → PlutusPurpose f DijkstraEra Source # toVotingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 Voter) Source # mkProposingPurpose ∷ f Word32 (ProposalProcedure DijkstraEra) → PlutusPurpose f DijkstraEra Source # toProposingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 (ProposalProcedure DijkstraEra)) Source # | |
pattern VotingPurpose ∷ ConwayEraScript era ⇒ f Word32 Voter → PlutusPurpose f era Source #
pattern ProposingPurpose ∷ ConwayEraScript era ⇒ f Word32 (ProposalProcedure era) → PlutusPurpose f era Source #
Dijkstra
class ConwayEraScript era ⇒ DijkstraEraScript era where Source #
Minimal complete definition
mkGuardingPurpose, toGuardingPurpose, mkRequireGuard, getRequireGuard
Methods
toGuardingPurpose ∷ PlutusPurpose f era → Maybe (f Word32 ScriptHash) Source #
Instances
| DijkstraEraScript DijkstraEra | |
Defined in Cardano.Ledger.Dijkstra.Scripts Methods mkGuardingPurpose ∷ f Word32 ScriptHash → PlutusPurpose f DijkstraEra Source # toGuardingPurpose ∷ PlutusPurpose f DijkstraEra → Maybe (f Word32 ScriptHash) Source # mkRequireGuard ∷ Credential 'Guard → NativeScript DijkstraEra Source # getRequireGuard ∷ NativeScript DijkstraEra → Maybe (Credential 'Guard) Source # | |
pattern GuardingPurpose ∷ DijkstraEraScript era ⇒ f Word32 ScriptHash → PlutusPurpose f era Source #