@@ -62,17 +62,13 @@ import Cardano.Ledger.BaseTypes (
62
62
ProtVer (.. ),
63
63
StrictMaybe (.. ),
64
64
UnitInterval ,
65
- invalidKey ,
66
65
succVersion ,
67
66
)
68
67
import Cardano.Ledger.Binary (
69
68
DecCBOR (.. ),
70
69
EncCBOR (.. ),
71
70
FromCBOR (.. ),
72
71
ToCBOR (.. ),
73
- decodeMapContents ,
74
- decodeRecordNamed ,
75
- decodeWord ,
76
72
encodeListLen ,
77
73
)
78
74
import Cardano.Ledger.Binary.Coders (Decode (From , RecD ), decode , (<!) )
@@ -84,7 +80,6 @@ import Cardano.Ledger.Orphans ()
84
80
import Cardano.Ledger.Shelley.Era (ShelleyEra )
85
81
import Cardano.Ledger.Slot (EpochNo (.. ), SlotNo (.. ))
86
82
import Control.DeepSeq (NFData )
87
- import Control.Monad (unless )
88
83
import Data.Aeson (
89
84
FromJSON (.. ),
90
85
Key ,
@@ -97,7 +92,6 @@ import Data.Aeson (
97
92
)
98
93
import qualified Data.Aeson as Aeson
99
94
import Data.Functor.Identity (Identity )
100
- import Data.List (nub )
101
95
import Data.Map.Strict (Map )
102
96
import qualified Data.Map.Strict as Map
103
97
import Data.Proxy
@@ -205,31 +199,6 @@ instance EraPParams ShelleyEra where
205
199
206
200
eraPParams = shelleyPParams
207
201
208
- instance Era era => DecCBOR (ShelleyPParams Identity era ) where
209
- decCBOR = do
210
- decodeRecordNamed " ShelleyPParams" (const 17 ) $
211
- ShelleyPParams @ Identity
212
- <$> decCBOR -- sppMinFeeA :: Integer
213
- <*> decCBOR -- sppMinFeeB :: Natural
214
- <*> decCBOR -- sppMaxBBSize :: Natural
215
- <*> decCBOR -- sppMaxTxSize :: Natural
216
- <*> decCBOR -- sppMaxBHSize :: Natural
217
- <*> decCBOR -- sppKeyDeposit :: Coin
218
- <*> decCBOR -- sppPoolDeposit :: Coin
219
- <*> decCBOR -- sppEMax :: EpochNo
220
- <*> decCBOR -- sppNOpt :: Natural
221
- <*> decCBOR -- sppA0 :: NonNegativeInterval
222
- <*> decCBOR -- sppRho :: UnitInterval
223
- <*> decCBOR -- sppTau :: UnitInterval
224
- <*> decCBOR -- sppD :: UnitInterval
225
- <*> decCBOR -- sppExtraEntropy :: Nonce
226
- <*> decCBOR -- sppProtocolVersion :: ProtVer
227
- <*> decCBOR -- sppMinUTxOValue :: Natural
228
- <*> decCBOR -- sppMinPoolCost :: Natural
229
-
230
- instance Era era => FromCBOR (ShelleyPParams Identity era ) where
231
- fromCBOR = fromEraCBOR @ era
232
-
233
202
instance
234
203
( EraPParams era
235
204
, PParamsHKD Identity era ~ ShelleyPParams Identity era
@@ -346,37 +315,6 @@ data PPUpdateEnv = PPUpdateEnv SlotNo GenDelegs
346
315
instance NoThunks PPUpdateEnv
347
316
348
317
{-# DEPRECATED PPUpdateEnv "As unused" #-}
349
- instance Era era => DecCBOR (ShelleyPParams StrictMaybe era ) where
350
- decCBOR = do
351
- mapParts <-
352
- decodeMapContents $
353
- decodeWord >>= \ case
354
- 0 -> decCBOR >>= \ x -> pure (0 , \ up -> up {sppMinFeeA = SJust x})
355
- 1 -> decCBOR >>= \ x -> pure (1 , \ up -> up {sppMinFeeB = SJust x})
356
- 2 -> decCBOR >>= \ x -> pure (2 , \ up -> up {sppMaxBBSize = SJust x})
357
- 3 -> decCBOR >>= \ x -> pure (3 , \ up -> up {sppMaxTxSize = SJust x})
358
- 4 -> decCBOR >>= \ x -> pure (4 , \ up -> up {sppMaxBHSize = SJust x})
359
- 5 -> decCBOR >>= \ x -> pure (5 , \ up -> up {sppKeyDeposit = SJust x})
360
- 6 -> decCBOR >>= \ x -> pure (6 , \ up -> up {sppPoolDeposit = SJust x})
361
- 7 -> decCBOR >>= \ x -> pure (7 , \ up -> up {sppEMax = SJust x})
362
- 8 -> decCBOR >>= \ x -> pure (8 , \ up -> up {sppNOpt = SJust x})
363
- 9 -> decCBOR >>= \ x -> pure (9 , \ up -> up {sppA0 = SJust x})
364
- 10 -> decCBOR >>= \ x -> pure (10 , \ up -> up {sppRho = SJust x})
365
- 11 -> decCBOR >>= \ x -> pure (11 , \ up -> up {sppTau = SJust x})
366
- 12 -> decCBOR >>= \ x -> pure (12 , \ up -> up {sppD = SJust x})
367
- 13 -> decCBOR >>= \ x -> pure (13 , \ up -> up {sppExtraEntropy = SJust x})
368
- 14 -> decCBOR >>= \ x -> pure (14 , \ up -> up {sppProtocolVersion = SJust x})
369
- 15 -> decCBOR >>= \ x -> pure (15 , \ up -> up {sppMinUTxOValue = SJust x})
370
- 16 -> decCBOR >>= \ x -> pure (16 , \ up -> up {sppMinPoolCost = SJust x})
371
- k -> invalidKey k
372
- let fields = fst <$> mapParts :: [Int ]
373
- unless
374
- (nub fields == fields)
375
- (fail $ " duplicate keys: " <> show fields)
376
- pure $ foldr ($) emptyShelleyPParamsUpdate (snd <$> mapParts)
377
-
378
- instance Era era => FromCBOR (ShelleyPParams StrictMaybe era ) where
379
- fromCBOR = fromEraCBOR @ era
380
318
381
319
instance
382
320
( EraPParams era
0 commit comments