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

Cardano.Ledger.Plutus.Evaluate

Synopsis

Documentation

data PlutusWithContext c where Source #

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

Constructors

PlutusWithContext 

Fields

  • PlutusLanguage l
     
  • ⇒ { pwcProtocolVersion ∷ !Version

    Mayjor 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 c)

    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 c
     

data ScriptFailure c Source #

Instances

Instances details
Generic (ScriptFailure c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Associated Types

type Rep (ScriptFailure c) ∷ TypeType Source #

Show (ScriptFailure c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

type Rep (ScriptFailure c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

type Rep (ScriptFailure c) = D1 ('MetaData "ScriptFailure" "Cardano.Ledger.Plutus.Evaluate" "cardano-ledger-core-1.16.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 c))))

data ScriptResult c Source #

Instances

Instances details
Monoid (ScriptResult c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Semigroup (ScriptResult c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Generic (ScriptResult c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

Associated Types

type Rep (ScriptResult c) ∷ TypeType Source #

type Rep (ScriptResult c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

data PlutusDebugInfo c 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 c)

    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 c) Source # 
Instance details

Defined in Cardano.Ledger.Plutus.Evaluate

explainPlutusEvaluationErrorPlutusWithContext c → EvaluationErrorScriptResult c 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