Skip to content

Commit

Permalink
Add explanatory comment fo filtersForEra function
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Mar 15, 2024
1 parent 754afe8 commit 785fed3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 785fed3

Please sign in to comment.