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

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

Documentation

data ExUnits Source #

Memory and CPU execution budget. Each unsigned component is bounded by 2^64-1.

Constructors

ExUnits

Assemble validated components.

Fields

Instances

Instances details
Show ExUnits Source # 
Instance details

Defined in Cometa.Internal.ProtocolValues

Eq ExUnits Source # 
Instance details

Defined in Cometa.Internal.ProtocolValues

Methods

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

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

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.