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

Cometa.Protocol.Version

Description

Ledger protocol versions with unsigned 64-bit major and 32-bit minor numbers.

ProtocolVersion 9 0 represents protocol version 9.0.

Synopsis

Documentation

data ProtocolVersion Source #

Protocol major/minor version; ordering compares major then minor.

Constructors

ProtocolVersion

Assemble validated components.

Fields

Instances

Instances details
Show ProtocolVersion Source # 
Instance details

Defined in Cometa.Internal.ProtocolValues

Eq ProtocolVersion Source # 
Instance details

Defined in Cometa.Internal.ProtocolValues

Ord ProtocolVersion Source # 
Instance details

Defined in Cometa.Internal.ProtocolValues

mkProtocolVersion :: Integer -> Integer -> Either Error ProtocolVersion Source #

Validate an external major in 0..2^64-1 and minor in 0..2^32-1. Invalid input returns InvalidProtocolVersion.

encodeCbor :: ProtocolVersion -> ByteString Source #

Encode a definite-length ledger CBOR value with shortest integer encodings.

decodeCbor :: ByteString -> Either Error ProtocolVersion 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.