cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cometa.Evaluation.Native

Description

Execute compiled Plutus V1–V4 scripts in process with explicit protocol context. Evaluation returns budgets without installing them or changing the enclosing transaction. Script availability depends on the protocol version.

import qualified Cometa.Evaluation as Evaluation
import qualified Cometa.Evaluation.Native as Native
import qualified Cometa.Protocol.CostModels as Models
import qualified Cometa.SlotConfig as Slots

localEvaluator = Native.evaluator (Native.Config Slots.preview 12 Models.empty)
-- Evaluation.evaluate localEvaluator Evaluation.TopLevel transaction resolved
Synopsis

Documentation

data Config Source #

Native evaluator context. The schedule applies to every validity interval; the protocol major selects language and builtin availability. Missing cost models use the built-in per-version defaults. This is phase-2 execution, not a check that the complete transaction is admissible on chain.

Constructors

Config 

Fields

Instances

Instances details
Show Config Source # 
Instance details

Defined in Cometa.Internal.Evaluation.Native

Eq Config Source # 
Instance details

Defined in Cometa.Internal.Evaluation.Native

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

evaluator :: Config -> Evaluator Source #

Construct an injectable evaluator. Every target evaluates all levels: a failure in any level fails the request, and execution consumes a shared limit of 100,000,000 memory units and 100,000,000,000 CPU steps. The target selects only which level's budgets are returned. No transaction bytes are changed.

All spending and reference inputs at every level must resolve exactly once; extra resolved UTxOs are allowed. Validity bounds must fit the supplied slot schedule. No scripts returns empty budgets after these checks.