Skip to content

Commit be6ba0f

Browse files
committed
Added non-zero check for nOpts in ppuWellFormed
1 parent 3d2ad3a commit be6ba0f

File tree

2 files changed

+5
-1
lines changed
  • eras

2 files changed

+5
-1
lines changed

eras/conway/impl/src/Cardano/Ledger/Conway/PParams.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ import Cardano.Ledger.BaseTypes (
108108
NonNegativeInterval,
109109
NonZero,
110110
PositiveInterval,
111-
ProtVer (ProtVer),
111+
ProtVer (..),
112112
ToKeyValuePairs (..),
113113
UnitInterval,
114114
integralToBounded,
@@ -119,6 +119,7 @@ import Cardano.Ledger.Binary (
119119
DecCBOR (..),
120120
EncCBOR (..),
121121
encodeListLen,
122+
natVersion,
122123
)
123124
import Cardano.Ledger.Binary.Coders
124125
import Cardano.Ledger.Coin (Coin (Coin), CompactForm (..), compactCoinOrError, partialCompactCoinL)
@@ -932,6 +933,8 @@ instance ConwayEraPParams ConwayEra where
932933
, hardforkConwayBootstrapPhase pv
933934
|| isValid ((/= zero) . unCoinPerByte) ppuCoinsPerUTxOByteL
934935
, ppu /= emptyPParamsUpdate
936+
, pvMajor pv < natVersion @11
937+
|| isValid (/= 0) ppuNOptL
935938
]
936939
where
937940
isValid ::

eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/PParams.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ instance ConwayEraPParams DijkstraEra where
541541
, isValid (/= zero) ppuDRepDepositL
542542
, isValid ((/= zero) . unCoinPerByte) ppuCoinsPerUTxOByteL
543543
, ppu /= emptyPParamsUpdate
544+
, isValid (/= 0) ppuNOptL
544545
]
545546
where
546547
isValid ::

0 commit comments

Comments
 (0)