plutus-ledger-api-1.0.0.1: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellNone
LanguageHaskell2010

Plutus.V2.Ledger.EvaluationContext

Synopsis

Documentation

type CostModelParams = Map Text Integer #

data EvaluationContext Source #

An opaque type that contains all the static parameters that the evaluator needs to evaluate a script. This is so that they can be computed once and cached, rather than recomputed on every evaluation.

There are two sets of parameters: one is with immediate unlifting and the other one is with deferred unlifting. We have to keep both of them, because depending on the language version either one has to be used or the other. We also compile them separately due to all the inlining and optimization that need to happen for things to be efficient.

Instances

Instances details
Generic EvaluationContext Source # 
Instance details

Defined in Plutus.ApiCommon

Associated Types

type Rep EvaluationContext :: Type -> Type Source #

NFData EvaluationContext Source # 
Instance details

Defined in Plutus.ApiCommon

Methods

rnf :: EvaluationContext -> () Source #

NoThunks EvaluationContext Source # 
Instance details

Defined in Plutus.ApiCommon

Methods

noThunks :: Context -> EvaluationContext -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> EvaluationContext -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy EvaluationContext -> String

type Rep EvaluationContext Source # 
Instance details

Defined in Plutus.ApiCommon

type Rep EvaluationContext = D1 ('MetaData "EvaluationContext" "Plutus.ApiCommon" "plutus-ledger-api-1.0.0.1-6EvbyJiK8IAAVEtnIJDu5Z" 'False) (C1 ('MetaCons "EvaluationContext" 'PrefixI 'True) (S1 ('MetaSel ('Just "machineParametersImmediate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DefaultMachineParameters) :*: S1 ('MetaSel ('Just "machineParametersDeferred") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DefaultMachineParameters)))

mkEvaluationContext :: MonadError CostModelApplyError m => CostModelParams -> m EvaluationContext Source #

Build the EvaluationContext.

The input is a Map of strings to cost integer values (aka CostModelParams, CostModel) See Note [Inlining meanings of builtins].

assertWellFormedCostModelParams :: MonadError CostModelApplyError m => CostModelParams -> m () Source #

Comparably expensive to mkEvaluationContext, so it should only be used sparingly.

costModelParamsForTesting :: CostModelParams Source #

The raw cost model params, only to be used for testing purposes.

evalCtxForTesting :: EvaluationContext Source #

only to be for testing purposes: make an evaluation context by applying an empty set of protocol parameters

costModelParamNames :: Set Text Source #

The set of valid names that a cost model parameter can take for this language version. It is used for the deserialization of CostModelParams.