@@ -23,6 +23,7 @@ import qualified Cardano.Ledger.Plutus as L
2323import qualified Cardano.Rpc.Client as Rpc
2424import qualified Cardano.Rpc.Proto.Api.UtxoRpc.Query as UtxoRpc
2525import Cardano.Rpc.Server.Internal.UtxoRpc.Query ()
26+ import Cardano.Rpc.Server.Internal.UtxoRpc.Type (anyUtxoDataUtxoRpcToUtxo )
2627import Cardano.Testnet
2728
2829import Prelude
@@ -126,10 +127,11 @@ hprop_rpc_query_pparams = integrationRetryWorkspace 2 "rpc-query-pparams" $ \tem
126127 pparams ^. L. ppCollateralPercentageL === chainParams ^. # collateralPercentage . to fromIntegral
127128 pparams ^. L. ppMaxCollateralInputsL === chainParams ^. # maxCollateralInputs . to fromIntegral
128129 let pparamsCostModels = L. getCostModelParams <$> pparams ^. L. ppCostModelsL . to L. costModelsValid
129- M. lookup L. PlutusV1 pparamsCostModels === chainParams ^. # costModels . # plutusV1 . # values . to Just
130- M. lookup L. PlutusV2 pparamsCostModels === chainParams ^. # costModels . # plutusV2 . # values . to Just
131- M. lookup L. PlutusV3 pparamsCostModels === chainParams ^. # costModels . # plutusV3 . # values . to Just
132- M. lookup L. PlutusV4 pparamsCostModels === chainParams ^. # costModels . # plutusV4 . # values . to Just
130+ wrapInMaybe v = if v == mempty then Nothing else Just v
131+ M. lookup L. PlutusV1 pparamsCostModels === chainParams ^. # costModels . # plutusV1 . # values . to wrapInMaybe
132+ M. lookup L. PlutusV2 pparamsCostModels === chainParams ^. # costModels . # plutusV2 . # values . to wrapInMaybe
133+ M. lookup L. PlutusV3 pparamsCostModels === chainParams ^. # costModels . # plutusV3 . # values . to wrapInMaybe
134+ M. lookup L. PlutusV4 pparamsCostModels === chainParams ^. # costModels . # plutusV4 . # values . to wrapInMaybe
133135 pparams ^. L. ppPricesL . to L. prSteps . to L. unboundRational === chainParams ^. # prices . # steps . to inject
134136 pparams ^. L. ppPricesL . to L. prMem . to L. unboundRational === chainParams ^. # prices . # memory . to inject
135137 pparams ^. L. ppMaxTxExUnitsL === chainParams ^. # maxExecutionUnitsPerTransaction . to inject
@@ -178,6 +180,7 @@ hprop_rpc_query_pparams = integrationRetryWorkspace 2 "rpc-query-pparams" $ \tem
178180 -- Test readUtxos response
179181 --------------------------
180182
181- _ <- H. noteShowPretty $ utxos
182- _ <- H. noteShowPretty $ utxosResponse
183+ utxoFromUtxoRpc <- H. leftFail $ utxosResponse ^. # items . to (anyUtxoDataUtxoRpcToUtxo $ convert ceo)
184+ utxos === utxoFromUtxoRpc
185+
183186 H. failure
0 commit comments