| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
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
- data ProtocolVersion = ProtocolVersion {}
- mkProtocolVersion :: Integer -> Integer -> Either Error ProtocolVersion
- encodeCbor :: ProtocolVersion -> ByteString
- decodeCbor :: ByteString -> Either Error ProtocolVersion
Documentation
data ProtocolVersion Source #
Protocol major/minor version; ordering compares major then minor.
Constructors
| ProtocolVersion | Assemble validated components. |
Instances
| Show ProtocolVersion Source # | |
Defined in Cometa.Internal.ProtocolValues Methods showsPrec :: Int -> ProtocolVersion -> ShowS # show :: ProtocolVersion -> String # showList :: [ProtocolVersion] -> ShowS # | |
| Eq ProtocolVersion Source # | |
Defined in Cometa.Internal.ProtocolValues Methods (==) :: ProtocolVersion -> ProtocolVersion -> Bool # (/=) :: ProtocolVersion -> ProtocolVersion -> Bool # | |
| Ord ProtocolVersion Source # | |
Defined in Cometa.Internal.ProtocolValues Methods compare :: ProtocolVersion -> ProtocolVersion -> Ordering # (<) :: ProtocolVersion -> ProtocolVersion -> Bool # (<=) :: ProtocolVersion -> ProtocolVersion -> Bool # (>) :: ProtocolVersion -> ProtocolVersion -> Bool # (>=) :: ProtocolVersion -> ProtocolVersion -> Bool # max :: ProtocolVersion -> ProtocolVersion -> ProtocolVersion # min :: ProtocolVersion -> ProtocolVersion -> ProtocolVersion # | |
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.