| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Plutus.ExUnits
Synopsis
- txscriptfee ∷ Prices → ExUnits → Coin
- pointWiseExUnits ∷ (Natural → Natural → Bool) → ExUnits → ExUnits → Bool
- zipSemiExUnits ∷ Semigroup a ⇒ (Natural → Natural → a) → ExUnits → ExUnits → a
- newtype ExUnits where
- WrapExUnits { }
- pattern ExUnits ∷ Natural → Natural → ExUnits
- data ExUnits' a = ExUnits' {
- exUnitsMem' ∷ !a
- exUnitsSteps' ∷ !a
- newtype OrdExUnits = OrdExUnits {}
- data Prices = Prices {}
Documentation
txscriptfee ∷ Prices → ExUnits → Coin Source #
Compute the cost of a script based upon prices and the number of execution units.
pointWiseExUnits ∷ (Natural → Natural → Bool) → ExUnits → ExUnits → Bool Source #
It is deliberate that there is no Ord instance for ExUnits. Use this function to
compare if one ExUnit is pointwise compareable to another. In case when Ord
instance like comparison is necessary you can use ,
or the zipSemiExUnits compareOrdExUnits newtype defined below.
zipSemiExUnits ∷ Semigroup a ⇒ (Natural → Natural → a) → ExUnits → ExUnits → a Source #
Pointwise combine units into a semigroup and mappened the results.
This newtype wrapper of ExUnits' is used to hide an implementation detail inside the ExUnits pattern.
Constructors
| WrapExUnits | |
Fields | |
Bundled Patterns
| pattern ExUnits ∷ Natural → Natural → ExUnits | Arbitrary execution unit in which we measure the cost of scripts in terms of space in memory and execution time. This pattern hides the fact that ExUnits' is parametric in the underlying type.
The ledger itself uses We would have preferred to use a type alias for |
Instances
| FromJSON ExUnits Source # | |||||
| ToJSON ExUnits Source # | |||||
| DecCBOR ExUnits Source # | |||||
| EncCBOR ExUnits Source # | |||||
| ToPlutusData ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ToPlutusData | |||||
| NFData ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits | |||||
| Monoid ExUnits Source # | |||||
| Semigroup ExUnits Source # | |||||
| Generic ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits Associated Types
| |||||
| Show ExUnits Source # | |||||
| Eq ExUnits Source # | |||||
| NoThunks ExUnits Source # | |||||
| type Rep ExUnits Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits | |||||
Arbitrary execution unit in which we measure the cost of scripts in terms of space in memory and execution time.
The ledger itself uses ExUnits Natural' exclusively, but the flexibility here
allows the consensus layer to translate the execution units into something
equivalent to 'ExUnits (Inf Natural)'. This is needed in order to provide
a BoundedMeasure instance, which itself is needed for the alonzo instance of
TxLimits (in consensus).
Constructors
| ExUnits' | |
Fields
| |
Instances
newtype OrdExUnits Source #
This is a helper type that allows us to define an Ord instance for executions units without
affecting the ExUnits type. This is needed in order to derive an Ord instance` for types
that need to contain an ExUnits. This is just a helper type and should not be used directly.
Constructors
| OrdExUnits | |
Fields | |
Instances
| FromJSON OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits Methods parseJSON ∷ Value → Parser OrdExUnits Source # parseJSONList ∷ Value → Parser [OrdExUnits] Source # | |
| ToJSON OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits Methods toJSON ∷ OrdExUnits → Value Source # toEncoding ∷ OrdExUnits → Encoding Source # toJSONList ∷ [OrdExUnits] → Value Source # toEncodingList ∷ [OrdExUnits] → Encoding Source # omitField ∷ OrdExUnits → Bool Source # | |
| DecCBOR OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits | |
| EncCBOR OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits Methods encCBOR ∷ OrdExUnits → Encoding Source # | |
| NFData OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits Methods rnf ∷ OrdExUnits → () # | |
| Show OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits Methods showsPrec ∷ Int → OrdExUnits → ShowS # show ∷ OrdExUnits → String # showList ∷ [OrdExUnits] → ShowS # | |
| Eq OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits | |
| Ord OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits Methods compare ∷ OrdExUnits → OrdExUnits → Ordering # (<) ∷ OrdExUnits → OrdExUnits → Bool # (<=) ∷ OrdExUnits → OrdExUnits → Bool # (>) ∷ OrdExUnits → OrdExUnits → Bool # (>=) ∷ OrdExUnits → OrdExUnits → Bool # max ∷ OrdExUnits → OrdExUnits → OrdExUnits # min ∷ OrdExUnits → OrdExUnits → OrdExUnits # | |
| NoThunks OrdExUnits Source # | |
Defined in Cardano.Ledger.Plutus.ExUnits | |
Prices per execution unit
Constructors
| Prices | |
Fields | |
Instances
| FromJSON Prices Source # | |||||
| ToJSON Prices Source # | |||||
| DecCBOR Prices Source # | |||||
| EncCBOR Prices Source # | |||||
| ToPlutusData Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ToPlutusData | |||||
| NFData Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits | |||||
| Generic Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits Associated Types
| |||||
| Show Prices Source # | |||||
| Eq Prices Source # | |||||
| Ord Prices Source # | |||||
| NoThunks Prices Source # | |||||
| type Rep Prices Source # | |||||
Defined in Cardano.Ledger.Plutus.ExUnits type Rep Prices = D1 ('MetaData "Prices" "Cardano.Ledger.Plutus.ExUnits" "cardano-ledger-core-1.22.0.0-inplace" 'False) (C1 ('MetaCons "Prices" 'PrefixI 'True) (S1 ('MetaSel ('Just "prMem") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NonNegativeInterval) :*: S1 ('MetaSel ('Just "prSteps") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NonNegativeInterval))) | |||||