plutus-ledger-api-1.30.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusLedgerApi.Common.ParamName

Synopsis

Documentation

class (Enum a, Bounded a) ⇒ IsParamName a where Source #

A parameter name for different plutus versions.

Each Plutus version should expose such an enumeration as an ADT and create an instance of ParamName out of it.

A valid parameter name has to be enumeration, bounded, ordered, and prettyprintable to a "lower-Kebab" string.

Minimal complete definition

showParamName

Methods

showParamName ∷ a → Text Source #

Produce the raw textual form for a given typed-by-plutus-version cost model parameter Any implementation *must be* an injective function. The GIsParamName generic implementation guarantees injectivity.

readParamName ∷ Text → Maybe a Source #

default implementation that inverts the showParamName operation (not very efficient)

Instances

Instances details
IsParamName ParamName Source # 
Instance details

Defined in PlutusLedgerApi.V1.ParamName

IsParamName ParamName Source # 
Instance details

Defined in PlutusLedgerApi.V2.ParamName

IsParamName ParamName Source # 
Instance details

Defined in PlutusLedgerApi.V3.ParamName

(Enum (GenericParamName a), Bounded (GenericParamName a), Generic a, GIsParamName (Rep a)) ⇒ IsParamName (GenericParamName a) Source # 
Instance details

Defined in PlutusLedgerApi.Common.ParamName

toCostModelParamsIsParamName p ⇒ [(p, Int64)] → CostModelParams Source #

Untags the plutus version from the typed cost model parameters and returns their raw textual form (internally used by CostModelInterface).

tagWithParamNames ∷ ∀ k m. (Enum k, Bounded k, MonadError CostModelApplyError m, MonadWriter [CostModelApplyWarn] m) ⇒ [Int64] → m [(k, Int64)] Source #

Given an ordered list of parameter values, tag them with their parameter names. If the passed parameter values are more than expected: the function will ignore the extraneous values at the tail of the list, if the passed values are less than expected: the function will throw an error; for more information, see Note [Cost model parameters from the ledger's point of view]

data CostModelApplyError Source #

A fatal error when trying to create a cost given some plain costmodel parameters.

Constructors

CMUnknownParamError !Text

a costmodel parameter with the give name does not exist in the costmodel to be applied upon

CMInternalReadError

internal error when we are transforming the applyParams' input to json (should not happen)

CMInternalWriteError !String

internal error when we are transforming the applied params from json with given jsonstring error (should not happen)

Instances

Instances details
Data CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → CostModelApplyError → c CostModelApplyError Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c CostModelApplyError Source #

toConstrCostModelApplyErrorConstr Source #

dataTypeOfCostModelApplyErrorDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c CostModelApplyError) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c CostModelApplyError) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → CostModelApplyErrorCostModelApplyError Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → CostModelApplyError → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → CostModelApplyError → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → CostModelApplyError → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → CostModelApplyError → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → CostModelApplyError → m CostModelApplyError Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → CostModelApplyError → m CostModelApplyError Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → CostModelApplyError → m CostModelApplyError Source #

Exception CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Generic CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Associated Types

type Rep CostModelApplyErrorTypeType Source #

Show CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

NFData CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Methods

rnfCostModelApplyError → () Source #

Eq CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

NoThunks CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

Methods

noThunks ∷ Context → CostModelApplyErrorIO (Maybe ThunkInfo)

wNoThunks ∷ Context → CostModelApplyErrorIO (Maybe ThunkInfo)

showTypeOfProxy CostModelApplyErrorString

Pretty CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

type Rep CostModelApplyError 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface

type Rep CostModelApplyError = D1 ('MetaData "CostModelApplyError" "PlutusCore.Evaluation.Machine.CostModelInterface" "plutus-core-1.30.0.0-inplace" 'False) (C1 ('MetaCons "CMUnknownParamError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: (C1 ('MetaCons "CMInternalReadError" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "CMInternalWriteError" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))))

data CostModelApplyWarn Source #

A non-fatal warning when trying to create a cost given some plain costmodel parameters.

Constructors

CMTooManyParamsWarn

See Note [Cost model parameters from the ledger's point of view]

Fields

CMTooFewParamsWarn

See Note [Cost model parameters from the ledger's point of view]

Fields

Instances

Instances details
Pretty CostModelApplyWarn 
Instance details

Defined in PlutusCore.Evaluation.Machine.CostModelInterface