File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
libs/cardano-ledger-binary
src/Cardano/Ledger/Binary/Decoding
testlib/Test/Cardano/Ledger/Binary Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11# Version history for ` cardano-ledger-binary `
22
3+ ## 1.7.1.0
4+
5+ * Disable decoding version ` 12 ` and higher.
6+
37## 1.7.0.0
48
59* Add ` Random ` instance for ` Version ` .
Original file line number Diff line number Diff line change 11cabal-version : 3.0
22name : cardano-ledger-binary
3- version : 1.7.0 .0
3+ version : 1.7.1 .0
44license : Apache-2.0
5566author : IOHK
Original file line number Diff line number Diff line change @@ -425,7 +425,10 @@ unlessDecoderVersionAtLeast atLeast decoder = do
425425--------------------------------------------------------------------------------
426426
427427decodeVersion :: Decoder s Version
428- decodeVersion = decodeWord64 >>= mkVersion64
428+ decodeVersion = do
429+ v <- decodeWord64 >>= mkVersion64
430+ when (v >= natVersion @ 12 ) $ fail " Version number 12 and higher are not yet supported"
431+ pure v
429432{-# INLINE decodeVersion #-}
430433
431434-- | `Decoder` for `Rational`. Versions variance:
Original file line number Diff line number Diff line change 11{-# LANGUAGE CPP #-}
2+ {-# LANGUAGE DataKinds #-}
23{-# LANGUAGE GeneralizedNewtypeDeriving #-}
34{-# LANGUAGE LambdaCase #-}
45{-# LANGUAGE MultiParamTypeClasses #-}
@@ -205,7 +206,7 @@ deriving instance Arbitrary SystemStart
205206deriving instance Arbitrary BlockNo
206207
207208instance Arbitrary Version where
208- arbitrary = genVersion minBound maxBound
209+ arbitrary = genVersion minBound (natVersion @ 11 )
209210
210211genVersion :: HasCallStack => Version -> Version -> Gen Version
211212genVersion minVersion maxVersion =
You can’t perform that action at this time.
0 commit comments