cardano-ledger-binary-1.10.0.0: Binary serialization library used throughout ledger
Safe HaskellNone
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

FromCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

ToCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

toCBOR ∷ Version → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Version → Size 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

NFData Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

rnf ∷ 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

Methods

showsPrec ∷ Int → Version → ShowS #

show ∷ Version → String #

showList ∷ [Version] → ShowS #

Eq Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

(==) ∷ Version → Version → Bool #

(/=) ∷ Version → Version → Bool #

Ord Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

compare ∷ Version → Version → Ordering #

(<) ∷ Version → Version → Bool #

(<=) ∷ Version → Version → Bool #

(>) ∷ Version → Version → Bool #

(>=) ∷ Version → Version → Bool #

max ∷ Version → Version → Version #

min ∷ Version → Version → Version #

NoThunks Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Random Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

randomR ∷ RandomGen g ⇒ (Version, Version) → g → (Version, g) Source #

random ∷ RandomGen g ⇒ g → (Version, g) Source #

randomRs ∷ RandomGen g ⇒ (Version, Version) → g → [Version] Source #

randoms ∷ RandomGen g ⇒ g → [Version] Source #

Uniform Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

uniformM ∷ StatefulGen g m ⇒ g → m Version Source #

UniformRange Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

uniformRM ∷ StatefulGen g m ⇒ (Version, Version) → g → m Version Source #

isInRange ∷ (Version, Version) → Version → Bool Source #

getVersion ∷ Integral 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 = 13 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 ∷ Nat). (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 ∷ ∀ (v ∷ Nat). (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

succVersion ∷ MonadFail 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.

mkVersion32 ∷ MonadFail m ⇒ Word32 → m Version Source #

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

mkVersion64 ∷ MonadFail m ⇒ Word64 → m Version Source #

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

getVersion32 ∷ Version → Word32 Source #

Extract Word32 representation of the Version

getVersion64 ∷ Version → Word64 Source #

Extract Word64 representation of the Version

Concrete era versions