| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Plutus.Evaluate
Synopsis
- data PlutusWithContext where
- PlutusWithContext ∷ ∀ (l ∷ Language). PlutusLanguage l ⇒ {..} → PlutusWithContext
- data ScriptFailure = ScriptFailure {}
- data ScriptResult
- scriptPass ∷ PlutusWithContext → ScriptResult
- scriptFail ∷ ScriptFailure → ScriptResult
- data PlutusDebugInfo
- data PlutusDebugOverrides = PlutusDebugOverrides {
- pdoScript ∷ !(Maybe ByteString)
- pdoProtocolVersion ∷ !(Maybe Version)
- pdoLanguage ∷ !(Maybe Language)
- pdoCostModelValues ∷ !(Maybe [Int64])
- pdoExUnitsMem ∷ !(Maybe Natural)
- pdoExUnitsSteps ∷ !(Maybe Natural)
- pdoExUnitsEnforced ∷ !Bool
- defaultPlutusDebugOverrides ∷ PlutusDebugOverrides
- debugPlutus ∷ HasCallStack ⇒ String → Int → PlutusDebugOverrides → IO PlutusDebugInfo
- debugPlutusUnbounded ∷ HasCallStack ⇒ String → PlutusDebugOverrides → PlutusDebugInfo
- runPlutusScript ∷ PlutusWithContext → ScriptResult
- runPlutusScriptWithLogs ∷ PlutusWithContext → ([Text], ScriptResult)
- evaluatePlutusWithContext ∷ VerboseMode → PlutusWithContext → ([Text], Either EvaluationError ExBudget)
- explainPlutusEvaluationError ∷ PlutusWithContext → EvaluationError → ScriptResult
Documentation
data PlutusWithContext where Source #
This type contains all that is necessary from Ledger to evaluate a plutus script.
Constructors
| PlutusWithContext | |
Fields
| |
Instances
| FromCBOR PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate | |
| ToCBOR PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods toCBOR ∷ PlutusWithContext → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PlutusWithContext → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PlutusWithContext] → Size Source # | |
| NFData PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods rnf ∷ PlutusWithContext → () # | |
| Show PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → PlutusWithContext → ShowS # show ∷ PlutusWithContext → String # showList ∷ [PlutusWithContext] → ShowS # | |
| Eq PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods | |
data ScriptFailure Source #
Constructors
| ScriptFailure | |
Instances
data ScriptResult Source #
Constructors
| Passes [PlutusWithContext] | |
| Fails [PlutusWithContext] (NonEmpty ScriptFailure) |
Instances
| Monoid ScriptResult Source # | |||||
Defined in Cardano.Ledger.Plutus.Evaluate Methods mappend ∷ ScriptResult → ScriptResult → ScriptResult # mconcat ∷ [ScriptResult] → ScriptResult # | |||||
| Semigroup ScriptResult Source # | |||||
Defined in Cardano.Ledger.Plutus.Evaluate Methods (<>) ∷ ScriptResult → ScriptResult → ScriptResult # sconcat ∷ NonEmpty ScriptResult → ScriptResult # stimes ∷ Integral b ⇒ b → ScriptResult → ScriptResult # | |||||
| Generic ScriptResult Source # | |||||
Defined in Cardano.Ledger.Plutus.Evaluate Associated Types
| |||||
| type Rep ScriptResult Source # | |||||
Defined in Cardano.Ledger.Plutus.Evaluate type Rep ScriptResult = D1 ('MetaData "ScriptResult" "Cardano.Ledger.Plutus.Evaluate" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "Passes" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PlutusWithContext])) :+: C1 ('MetaCons "Fails" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PlutusWithContext]) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty ScriptFailure)))) | |||||
data PlutusDebugInfo Source #
Constructors
| DebugBadHex String | |
| DebugCannotDecode String | |
| DebugSuccess | |
| DebugFailure | |
Fields
| |
| DebugTimedOut | Script did not terminate within the imposed limit |
Fields
| |
Instances
| NFData PlutusDebugInfo Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods rnf ∷ PlutusDebugInfo → () # | |
| Show PlutusDebugInfo Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → PlutusDebugInfo → ShowS # show ∷ PlutusDebugInfo → String # showList ∷ [PlutusDebugInfo] → ShowS # | |
data PlutusDebugOverrides Source #
Various overrides that can be supplied to plutusDebug and plutusDebugUnbouded
Constructors
| PlutusDebugOverrides | |
Fields
| |
Instances
| Show PlutusDebugOverrides Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → PlutusDebugOverrides → ShowS # show ∷ PlutusDebugOverrides → String # showList ∷ [PlutusDebugOverrides] → ShowS # | |
debugPlutus ∷ HasCallStack ⇒ String → Int → PlutusDebugOverrides → IO PlutusDebugInfo Source #
Execute a hex encoded script with the context that was produced within the ledger predicate
failure. Using PlutusDebugOverrides it is possible to override any part of the execution.
debugPlutusUnbounded ∷ HasCallStack ⇒ String → PlutusDebugOverrides → PlutusDebugInfo Source #
This is just like debugPlutus, except it is pure and if a supplied script contains an
infinite loop or a very expensive computation, it might not terminate within a reasonable
timeframe.
evaluatePlutusWithContext ∷ VerboseMode → PlutusWithContext → ([Text], Either EvaluationError ExBudget) Source #
explainPlutusEvaluationError ∷ PlutusWithContext → EvaluationError → ScriptResult Source #
Explain why a script might fail. Scripts come in three flavors:
- with 3 arguments
[data,redeemer,context]forPlutusV1andPlustuV2 - with 2 arguments
[redeemer,context]forPlutusV1andPlustuV2 - with 1 argument
contextforPlutusV3onwards