| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Protocol.ExUnits
Description
Script execution budgets in memory units and CPU steps. Each component fits an unsigned 64-bit integer.
ExUnits 14000000 10000000000 assembles a validated machine budget.
Synopsis
- data ExUnits = ExUnits {}
- mkExUnits :: Integer -> Integer -> Either Error ExUnits
- encodeCbor :: ExUnits -> ByteString
- decodeCbor :: ByteString -> Either Error ExUnits
Documentation
Memory and CPU execution budget. Each unsigned component is bounded by 2^64-1.
Constructors
| ExUnits | Assemble validated components. |
mkExUnits :: Integer -> Integer -> Either Error ExUnits Source #
Validate external memory and step counts in 0..2^64-1. Invalid input
returns InvalidExUnits.
encodeCbor :: ExUnits -> ByteString Source #
Encode a definite-length ledger CBOR value with shortest integer encodings.
decodeCbor :: ByteString -> Either Error ExUnits Source #
Decode exactly one ledger CBOR value. Invalid fields or trailing data return
InvalidProtocolCbor. Nonminimal integers and indefinite arrays
are accepted; output encoding uses definite arrays and shortest integers.