Skip to content

Commit

Permalink
[ADP-3229] Create dummy value for currentProtocolParametersInRecentEr…
Browse files Browse the repository at this point in the history
…as in bench… (#4247)

- [x] Add a dummy value in api benchmark for
currentProtocolParametersInRecentEras

This fixes [api
benchmarks](https://buildkite.com/cardano-foundation/cardano-wallet-nightly/builds/228#018be6ed-8720-4031-a5c1-4f853d2a4b1e)

ADP-3229
  • Loading branch information
paolino authored Nov 19, 2023
2 parents a1c425d + 663678b commit 6e91289
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/wallet/bench/api-bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import Cardano.Wallet.DB.Layer
)
import Cardano.Wallet.DummyTarget.Primitive.Types
( dummyNetworkLayer
, dummyNodeProtocolParameters
, dummyProtocolParameters
, dummySlottingParameters
, dummyTimeInterpreter
Expand Down Expand Up @@ -175,6 +176,7 @@ import Say
)

import qualified Cardano.Api as Cardano
import qualified Cardano.Api as C
import qualified Cardano.Wallet as W
import qualified Cardano.Wallet.DB as DB
import qualified Cardano.Wallet.DB.Layer as DB
Expand All @@ -186,6 +188,8 @@ import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Char8 as B8
import qualified Data.Map.Strict as Map
import qualified Data.Text as T
import qualified Internal.Cardano.Write.ProtocolParameters as Write
import qualified Internal.Cardano.Write.Tx as Write
import qualified System.Environment as Sys
import qualified System.Exit as Sys

Expand Down Expand Up @@ -533,6 +537,12 @@ mockNetworkLayer = dummyNetworkLayer
{ timeInterpreter = hoistTimeInterpreter liftIO mockTimeInterpreter
, currentSlottingParameters = pure dummySlottingParameters
, currentProtocolParameters = pure dummyProtocolParameters
, currentProtocolParametersInRecentEras = pure
$ Write.InRecentEraBabbage . Write.ProtocolParameters $
either (error . show) id $
C.toLedgerPParams
C.ShelleyBasedEraBabbage
dummyNodeProtocolParameters
, currentNodeEra = pure $ Cardano.anyCardanoEra Cardano.BabbageEra
, currentNodeTip = pure BlockHeader
{ slotNo = SlotNo 123456789
Expand Down

0 comments on commit 6e91289

Please sign in to comment.