Skip to content

Commit

Permalink
Fix issue from rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Mar 15, 2024
1 parent 785fed3 commit 6cceb23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions cardano-api/internal/Cardano/Api/ProtocolParameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1744,8 +1744,7 @@ fromExactlyAlonzoPParams :: (AlonzoEraPParams ledgerera, Ledger.ExactEra Ledger.
-> ProtocolParameters
fromExactlyAlonzoPParams pp =
(fromAlonzoPParams pp) {
protocolParamUTxOCostPerByte = Just . fromShelleyLovelace . unCoinPerWord $
pp ^. ppCoinsPerUTxOWordL
protocolParamUTxOCostPerByte = Just . unCoinPerWord $ pp ^. ppCoinsPerUTxOWordL
}

fromBabbagePParams :: BabbageEraPParams ledgerera
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module Test.Golden.Cardano.Api.ProtocolParameters
) where

import Cardano.Api (AnyPlutusScriptVersion (AnyPlutusScriptVersion), CostModel (..),
ExecutionUnits (..), Lovelace (..), PlutusScriptVersion (..), makePraosNonce)
import Cardano.Api.Ledger (EpochInterval (EpochInterval), StandardCrypto)
ExecutionUnits (..), PlutusScriptVersion (..), makePraosNonce)
import Cardano.Api.Ledger (Coin (..), EpochInterval (EpochInterval), StandardCrypto)
import Cardano.Api.ProtocolParameters (ExecutionUnitPrices (..), ProtocolParameters (..))

import Cardano.Ledger.Alonzo (AlonzoEra)
Expand Down Expand Up @@ -60,20 +60,20 @@ goldenProtocolParametersToPParams _ =
decodedLegacyCardanoApiProtocolParameters = eitherDecode bytestringLegacyCardanoApiProtocolParameters

legacyCardanoApiProtocolParameters :: ProtocolParameters
legacyCardanoApiProtocolParameters = ProtocolParameters { protocolParamUTxOCostPerByte = Just $ Lovelace 1_000_000
, protocolParamTxFeePerByte = Lovelace 2_000_000
, protocolParamTxFeeFixed = Lovelace 1_500_000
legacyCardanoApiProtocolParameters = ProtocolParameters { protocolParamUTxOCostPerByte = Just $ Coin 1_000_000
, protocolParamTxFeePerByte = Coin 2_000_000
, protocolParamTxFeeFixed = Coin 1_500_000
, protocolParamTreasuryCut = 0.1
, protocolParamStakePoolTargetNum = 100
, protocolParamStakePoolDeposit = Lovelace 1_000_000_000
, protocolParamStakeAddressDeposit = Lovelace 10_000_000
, protocolParamStakePoolDeposit = Coin 1_000_000_000
, protocolParamStakeAddressDeposit = Coin 10_000_000
, protocolParamProtocolVersion = (2, 3)
, protocolParamPrices = Just executionUnitPrices
, protocolParamPoolRetireMaxEpoch = Cardano.Api.Ledger.EpochInterval 4
, protocolParamPoolPledgeInfluence = 0.54
, protocolParamMonetaryExpansion = 0.23
, protocolParamMinUTxOValue = Just $ Lovelace 3_000_000
, protocolParamMinPoolCost = Lovelace 3_500_000
, protocolParamMinUTxOValue = Just $ Coin 3_000_000
, protocolParamMinPoolCost = Coin 3_500_000
, protocolParamMaxValueSize = Just 10
, protocolParamMaxTxSize = 3000
, protocolParamMaxTxExUnits = Just executionUnits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tests =
]
]

-- | Compares the JSON serialization of cardano-ledger's PParams and cardano-api's ProtocolParameters and
-- | Compares the JSON serialization of cardano-ledger's PParams and cardano-api's ProtocolParameters and
-- | ensures that they are the same (except for the agreed changes specified in `patchProtocolParamsJSONOrFail`)
protocolParametersSerializeTheSame :: forall era. ToJSON (PParams (ShelleyLedgerEra era)) => CardanoEra era -> Property
protocolParametersSerializeTheSame era =
Expand Down

0 comments on commit 6cceb23

Please sign in to comment.