cardano-ledger-binary-1.5.0.0: Binary serialization library used throughout ledger
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Binary.Version

Synopsis

Versioning

data Version Source #

Protocol version number that is used during encoding and decoding. All supported versions are in the range from MinVersion to MaxVersion.

Instances

Instances details
FromJSON Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

ToJSON Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Bounded Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Enum Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Show Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

FromCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

ToCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

toCBORVersionEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VersionSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Version] → Size Source #

DecCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Decoding.DecCBOR

EncCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Encoding.EncCBOR

Methods

encCBORVersionEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy VersionSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Version] → Size Source #

NFData Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

rnfVersion → () Source #

Eq Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

(==)VersionVersionBool Source #

(/=)VersionVersionBool Source #

Ord Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

NoThunks Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

getVersionIntegral i ⇒ Version → i Source #

Convert a Version to an Integral value.

Note - Version spans a fairly small range of non-negative numbers, so this should be safe even for smallest integral types.

type MinVersion = 0 Source #

Minimum supported version

type MaxVersion = 11 Source #

Maximum supported version. This is the major protocol version of the latest known protocol version that we want to support, including for development and testing.

natVersion ∷ ∀ v. (KnownNat v, MinVersion <= v, v <= MaxVersion) ⇒ Version Source #

Same as natVersionProxy, construct a version from a type level Nat, except it can be supplied through TypeApplications.

natVersionProxy ∷ (KnownNat v, MinVersion <= v, v <= MaxVersion) ⇒ Proxy v → Version Source #

Safely construct a Version from a type level Nat, which is supplied as a Proxy

succVersionMonadFail m ⇒ Version → m Version Source #

Increment version by 1.

mkVersion ∷ (Integral i, MonadFail m) ⇒ i → m Version Source #

Construct a Version and fail if the supplied value is not a supported version number.

mkVersion64MonadFail m ⇒ Word64 → m Version Source #

Construct a Version and fail if the supplied value is not supported version number.

getVersion64VersionWord64 Source #

Extract Word64 representation of the Version

Concrete era versions