cardano-ledger-core-1.17.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Plutus.Evaluate

Synopsis

Documentation

data PlutusWithContext where Source #

This type contains all that is necessary from Ledger to evaluate a plutus script.

Constructors

PlutusWithContext 

Fields

  • PlutusLanguage l
     
  • ⇒ { pwcProtocolVersion ∷ !Version

    Major protocol version that is necessary for [de]serialization

  •   , pwcScript ∷ !(Either (Plutus l) (PlutusRunnable l))

    Actual plutus script that will be evaluated. Script is allowed to be in two forms: serialized and deserialized. This is necesary for implementing the opptimization that preserves deserialized PlutusRunnable after verifying wellformedness of plutus scripts during transaction validation (yet to be implemented).

  •   , pwcScriptHash ∷ !ScriptHash

    Hash of the above script as it would appear on-chain. In other words it is not just a hash of the script contents. (See hashScript for more info)

  •   , pwcArgs ∷ !(PlutusArgs l)

    All of the arguments to the Plutus scripts, including the redeemer and the Plutus context that was obtained from the transaction translation

  •   , pwcExUnits ∷ !ExUnits

    Limit on the execution units

  •   , pwcCostModel ∷ !CostModel

    CostModel to be used during script evaluation. It must match the language version in the pwcScript

  •   } → PlutusWithContext
     

data ScriptFailure Source #

Instances

Instances details
Generic ScriptFailure Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Associated Types

type Rep ScriptFailureTypeType Source #

Show ScriptFailure Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

type Rep ScriptFailure Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

type Rep ScriptFailure = D1 ('MetaData "ScriptFailure" "Cardano.Ledger.Plutus.Evaluate" "cardano-ledger-core-1.17.0.0-inplace" 'False) (C1 ('MetaCons "ScriptFailure" 'PrefixI 'True) (S1 ('MetaSel ('Just "scriptFailureMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "scriptFailurePlutus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlutusWithContext)))

data ScriptResult Source #

Instances

Instances details
Monoid ScriptResult Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Semigroup ScriptResult Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Generic ScriptResult Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Associated Types

type Rep ScriptResultTypeType Source #

type Rep ScriptResult Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

data PlutusDebugInfo Source #

Constructors

DebugBadHex String 
DebugCannotDecode String 
DebugSuccess 

Fields

  • [Text]

    Execution logs from the plutus interpreter

  • ExBudget

    Execution budget that was consumed. It will always be less or equal to what was supplied during execution.

DebugFailure 

Fields

  • [Text]

    Execution logs from the plutus interpreter

  • EvaluationError

    Evaluation error from Plutus interpreter

  • PlutusWithContext

    Everything that is needed in order to run the script

  • (Maybe ExBudget)

    Expected execution budget. This value is Nothing when the supplied script can't be executed within 5 second limit or there is a problem with decoding plutus script itself.

Instances

Instances details
Show PlutusDebugInfo Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

explainPlutusEvaluationErrorPlutusWithContextEvaluationErrorScriptResult Source #

Explain why a script might fail. Scripts come in three flavors:

  1. with 3 arguments [data,redeemer,context] for PlutusV1 and PlustuV2
  2. with 2 arguments [redeemer,context] for PlutusV1 and PlustuV2
  3. with 1 argument context for PlutusV3 onwards