cardano-ledger-alonzo-1.14.0.0: Cardano ledger introducing Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Alonzo.Plutus.Context

Synopsis

Documentation

data LedgerTxInfo era Source #

All information that is necessary from the ledger to construct Plutus' TxInfo.

Constructors

LedgerTxInfo 

Fields

class (AlonzoEraScript era, Eq (ContextError era), Show (ContextError era), NFData (ContextError era), NoThunks (ContextError era), EncCBOR (ContextError era), DecCBOR (ContextError era), ToJSON (ContextError era)) ⇒ EraPlutusContext era where Source #

Associated Types

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

data TxInfoResult era ∷ Type Source #

This data type family is used to memoize the results of toPlutusTxInfo, so the outcome can be shared between execution of different scripts with the same language version.

Methods

mkSupportedLanguageLanguageMaybe (SupportedLanguage era) Source #

mkTxInfoResultLedgerTxInfo era → TxInfoResult era Source #

Construct PlutusTxInfo for all supported languages in this era.

lookupTxInfoResultEraPlutusTxInfo l era ⇒ SLanguage l → TxInfoResult era → Either (ContextError era) (PlutusTxInfo l) Source #

TxInfo for the same language can be shared between executions of every script of the same version in a single transaction.

Note - The EraPlutusTxInfo is here only to enforce this function is not called with an unsupported plutus language version.

mkPlutusWithContextPlutusScript era → ScriptHashPlutusPurpose AsIxItem era → LedgerTxInfo era → TxInfoResult era → (Data era, ExUnits) → CostModelEither (ContextError era) PlutusWithContext Source #

lookupTxInfoResultImpossible ∷ (HasCallStack, EraPlutusTxInfo l era) ⇒ SLanguage l → Either (ContextError era) (PlutusTxInfo l) Source #

Helper function to use when implementing lookupTxInfoResult for plutus languages that are not supported by the era.

data SupportedLanguage era where Source #

Constructors

SupportedLanguageEraPlutusTxInfo l era ⇒ SLanguage l → SupportedLanguage era 

Instances

Instances details
Show (SupportedLanguage era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Plutus.Context

EraPlutusContext era ⇒ DecCBOR (SupportedLanguage era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Plutus.Context

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

Defined in Cardano.Ledger.Alonzo.Plutus.Context

Methods

encCBORSupportedLanguage era → Encoding Source #

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

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

Eq (SupportedLanguage era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Plutus.Context

Ord (SupportedLanguage era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Plutus.Context

mkSupportedPlutusScript ∷ ∀ l era. (HasCallStack, EraPlutusTxInfo l era) ⇒ Plutus l → PlutusScript era Source #

This is just like mkPlutusScript, except it is guaranteed to be total through the enforcement of support by the type system and EraPlutusTxInfo type class instances for supported plutus versions.

mkSupportedBinaryPlutusScript ∷ ∀ era. (HasCallStack, AlonzoEraScript era) ⇒ SupportedLanguage era → PlutusBinaryPlutusScript era Source #

This is just like mkBinaryPlutusScript, except it is guaranteed to be total through the enforcement of support by the type system and EraPlutusTxInfo type class instances (via calling `mkSupportedPlutusScript) for supported plutus versions.

Language dependent translation