diff --git a/cardano-api/test/cardano-api-test/Test/Cardano/Api/ProtocolParameters.hs b/cardano-api/test/cardano-api-test/Test/Cardano/Api/ProtocolParameters.hs index 6c446ba405..191029f3bc 100644 --- a/cardano-api/test/cardano-api-test/Test/Cardano/Api/ProtocolParameters.hs +++ b/cardano-api/test/cardano-api-test/Test/Cardano/Api/ProtocolParameters.hs @@ -127,6 +127,11 @@ patchProtocolParamsJSONOrFail era b = maybe (fail "Cannot fix JSON") return $ pa =<< replace "minCommitteeSize" "committeeMinSize" (applyFilters filters o) + -- | Legacy ProtocolParams ToJSON renders all fields from all eras in all eras, + -- | because it is the same data type for every era. But this is not backwards compatible + -- | because it means that new eras can modify the fields in old eras. For this reason, when + -- | comparing to PParams we use this function to filter fields that don't belong to + -- | particular era we are testing. filtersForEra :: CardanoEra era -> Maybe [String] filtersForEra ShelleyEra = Just [ "collateralPercentage", "costModels", "executionUnitPrices" , "maxBlockExecutionUnits", "maxCollateralInputs", "maxTxExecutionUnits"