Skip to content

Commit e50fea0

Browse files
committed
Remove explicit DecCBOR, FromCBOR instances for ConwayPParams
in favour of the ones defined in `EraPParams`
1 parent 1501393 commit e50fea0

File tree

1 file changed

+0
-82
lines changed
  • eras/conway/impl/src/Cardano/Ledger/Conway

1 file changed

+0
-82
lines changed

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

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ import Cardano.Ledger.BaseTypes (
103103
import Cardano.Ledger.Binary (
104104
DecCBOR (..),
105105
EncCBOR (..),
106-
FromCBOR (..),
107106
encodeListLen,
108107
)
109108
import Cardano.Ledger.Binary.Coders
@@ -887,46 +886,6 @@ instance ConwayEraPParams ConwayEra where
887886
hkdMinFeeRefScriptCostPerByteL =
888887
lens (unTHKD . cppMinFeeRefScriptCostPerByte) $ \pp x -> pp {cppMinFeeRefScriptCostPerByte = THKD x}
889888

890-
instance Era era => DecCBOR (ConwayPParams Identity era) where
891-
decCBOR =
892-
decode $
893-
RecD (ConwayPParams @Identity)
894-
<! From
895-
<! From
896-
<! From
897-
<! From
898-
<! From
899-
<! From
900-
<! From
901-
<! From
902-
<! From
903-
<! From
904-
<! From
905-
<! From
906-
<! From
907-
<! From
908-
<! From
909-
<! From
910-
<! From
911-
<! From
912-
<! From
913-
<! From
914-
<! From
915-
<! From
916-
-- -- New for Conway
917-
<! From
918-
<! From
919-
<! From
920-
<! From
921-
<! From
922-
<! From
923-
<! From
924-
<! From
925-
<! From
926-
927-
instance Era era => FromCBOR (ConwayPParams Identity era) where
928-
fromCBOR = fromEraCBOR @era
929-
930889
instance ToJSON (ConwayPParams Identity ConwayEra) where
931890
toJSON = object . conwayPParamsPairs
932891
toEncoding = pairs . mconcat . conwayPParamsPairs
@@ -1052,47 +1011,6 @@ emptyConwayPParamsUpdate =
10521011
, cppMinFeeRefScriptCostPerByte = THKD SNothing
10531012
}
10541013

1055-
updateField :: Word -> Field (ConwayPParams StrictMaybe era)
1056-
updateField = \case
1057-
0 -> field (\x up -> up {cppMinFeeA = THKD (SJust x)}) From
1058-
1 -> field (\x up -> up {cppMinFeeB = THKD (SJust x)}) From
1059-
2 -> field (\x up -> up {cppMaxBBSize = THKD (SJust x)}) From
1060-
3 -> field (\x up -> up {cppMaxTxSize = THKD (SJust x)}) From
1061-
4 -> field (\x up -> up {cppMaxBHSize = THKD (SJust x)}) From
1062-
5 -> field (\x up -> up {cppKeyDeposit = THKD (SJust x)}) From
1063-
6 -> field (\x up -> up {cppPoolDeposit = THKD (SJust x)}) From
1064-
7 -> field (\x up -> up {cppEMax = THKD (SJust x)}) From
1065-
8 -> field (\x up -> up {cppNOpt = THKD (SJust x)}) From
1066-
9 -> field (\x up -> up {cppA0 = THKD (SJust x)}) From
1067-
10 -> field (\x up -> up {cppRho = THKD (SJust x)}) From
1068-
11 -> field (\x up -> up {cppTau = THKD (SJust x)}) From
1069-
16 -> field (\x up -> up {cppMinPoolCost = THKD (SJust x)}) From
1070-
17 -> field (\x up -> up {cppCoinsPerUTxOByte = THKD (SJust x)}) From
1071-
18 -> field (\x up -> up {cppCostModels = THKD (SJust x)}) From
1072-
19 -> field (\x up -> up {cppPrices = THKD (SJust x)}) From
1073-
20 -> field (\x up -> up {cppMaxTxExUnits = THKD (SJust x)}) From
1074-
21 -> field (\x up -> up {cppMaxBlockExUnits = THKD (SJust x)}) From
1075-
22 -> field (\x up -> up {cppMaxValSize = THKD (SJust x)}) From
1076-
23 -> field (\x up -> up {cppCollateralPercentage = THKD (SJust x)}) From
1077-
24 -> field (\x up -> up {cppMaxCollateralInputs = THKD (SJust x)}) From
1078-
-- New for Conway
1079-
25 -> field (\x up -> up {cppPoolVotingThresholds = THKD (SJust x)}) From
1080-
26 -> field (\x up -> up {cppDRepVotingThresholds = THKD (SJust x)}) From
1081-
27 -> field (\x up -> up {cppCommitteeMinSize = THKD (SJust x)}) From
1082-
28 -> field (\x up -> up {cppCommitteeMaxTermLength = THKD (SJust x)}) From
1083-
29 -> field (\x up -> up {cppGovActionLifetime = THKD (SJust x)}) From
1084-
30 -> field (\x up -> up {cppGovActionDeposit = THKD (SJust x)}) From
1085-
31 -> field (\x up -> up {cppDRepDeposit = THKD (SJust x)}) From
1086-
32 -> field (\x up -> up {cppDRepActivity = THKD (SJust x)}) From
1087-
33 -> field (\x up -> up {cppMinFeeRefScriptCostPerByte = THKD (SJust x)}) From
1088-
k -> invalidField k
1089-
1090-
instance Era era => DecCBOR (ConwayPParams StrictMaybe era) where
1091-
decCBOR = decode (SparseKeyed "PParamsUpdate" emptyConwayPParamsUpdate updateField [])
1092-
1093-
instance Era era => FromCBOR (ConwayPParams StrictMaybe era) where
1094-
fromCBOR = fromEraCBOR @era
1095-
10961014
instance
10971015
( ConwayEraPParams era
10981016
, PParamsHKD StrictMaybe era ~ ConwayPParams StrictMaybe era

0 commit comments

Comments
 (0)