@@ -110,14 +110,9 @@ import Cardano.Ledger.Plutus.Language (Language (..))
110
110
import Cardano.Ledger.Shelley.PParams
111
111
import Control.DeepSeq (NFData )
112
112
import Data.Aeson as Aeson (
113
- FromJSON ( parseJSON ) ,
113
+ FromJSON ,
114
114
Key ,
115
- KeyValue ((.=) ),
116
115
ToJSON (.. ),
117
- object ,
118
- pairs ,
119
- withObject ,
120
- (.:) ,
121
116
)
122
117
import qualified Data.Aeson.Types as Aeson
123
118
import Data.ByteString (ByteString )
@@ -397,47 +392,6 @@ instance EraGov AlonzoEra where
397
392
398
393
obligationGovState = const mempty
399
394
400
- instance ToJSON (AlonzoPParams Identity AlonzoEra ) where
401
- toJSON = object . alonzoPParamsPairs
402
- toEncoding = pairs . mconcat . alonzoPParamsPairs
403
-
404
- alonzoPParamsPairs ::
405
- forall a e .
406
- KeyValue e a =>
407
- PParamsHKD Identity AlonzoEra ->
408
- [a ]
409
- alonzoPParamsPairs pp =
410
- uncurry (.=) <$> alonzoPParamsHKDPairs (Proxy @ Identity ) pp
411
-
412
- instance FromJSON (AlonzoPParams Identity era ) where
413
- parseJSON =
414
- Aeson. withObject " PParams" $ \ obj ->
415
- AlonzoPParams
416
- <$> obj .: " txFeePerByte"
417
- <*> obj .: " txFeeFixed"
418
- <*> obj .: " maxBlockBodySize"
419
- <*> obj .: " maxTxSize"
420
- <*> obj .: " maxBlockHeaderSize"
421
- <*> obj .: " stakeAddressDeposit"
422
- <*> obj .: " stakePoolDeposit"
423
- <*> obj .: " poolRetireMaxEpoch"
424
- <*> obj .: " stakePoolTargetNum"
425
- <*> obj .: " poolPledgeInfluence"
426
- <*> obj .: " monetaryExpansion"
427
- <*> obj .: " treasuryCut"
428
- <*> obj .: " decentralization"
429
- <*> obj .: " extraPraosEntropy"
430
- <*> obj .: " protocolVersion"
431
- <*> obj .: " minPoolCost"
432
- <*> obj .: " utxoCostPerByte"
433
- <*> obj .: " costModels"
434
- <*> obj .: " executionUnitPrices"
435
- <*> obj .: " maxTxExecutionUnits"
436
- <*> obj .: " maxBlockExecutionUnits"
437
- <*> obj .: " maxValueSize"
438
- <*> obj .: " collateralPercentage"
439
- <*> obj .: " maxCollateralInputs"
440
-
441
395
newtype CoinPerWord = CoinPerWord { unCoinPerWord :: Coin }
442
396
deriving stock (Eq , Ord )
443
397
deriving newtype (EncCBOR , DecCBOR , ToJSON , FromJSON , NFData , NoThunks , Show )
@@ -562,32 +516,6 @@ emptyAlonzoPParamsUpdate =
562
516
, appMaxCollateralInputs = SNothing
563
517
}
564
518
565
- instance ToJSON (AlonzoPParams StrictMaybe AlonzoEra ) where
566
- toJSON = object . alonzoPParamsUpdatePairs
567
- toEncoding = pairs . mconcat . alonzoPParamsUpdatePairs
568
-
569
- alonzoPParamsUpdatePairs ::
570
- forall a e .
571
- KeyValue e a =>
572
- PParamsHKD StrictMaybe AlonzoEra ->
573
- [a ]
574
- alonzoPParamsUpdatePairs pp =
575
- [ k .= v
576
- | (k, SJust v) <- alonzoPParamsHKDPairs (Proxy @ StrictMaybe ) pp
577
- ]
578
-
579
- alonzoPParamsHKDPairs ::
580
- forall f .
581
- HKDFunctor f =>
582
- Proxy f ->
583
- PParamsHKD f AlonzoEra ->
584
- [(Key , HKD f Aeson. Value )]
585
- alonzoPParamsHKDPairs px pp =
586
- alonzoCommonPParamsHKDPairs px pp
587
- ++ shelleyCommonPParamsHKDPairsV8 px pp
588
- ++ shelleyCommonPParamsHKDPairsV6 px pp
589
- ++ [(" utxoCostPerByte" , hkdMap px (toJSON @ CoinPerWord ) (pp ^. hkdCoinsPerUTxOWordL @ _ @ f ))]
590
-
591
519
-- | These are the fields that are common across all eras starting with Alonzo.
592
520
alonzoCommonPParamsHKDPairs ::
593
521
forall f era .
0 commit comments