@@ -95,10 +95,6 @@ import Control.Concurrent.STM qualified as STM
9595------------------
9696import Control.Monad.Trans.Except (runExceptT )
9797------------------
98- -- tx-generator --
99- ------------------
100- import Cardano.TxGenerator.ProtocolParameters qualified as PP
101- ------------------
10298-- pull-fiction --
10399------------------
104100import Cardano.Benchmarking.PullFiction.Config.Raw qualified as Raw
@@ -123,7 +119,7 @@ main = do
123119 -- Config.
124120 ----------
125121
126- (runtime, codecConfig, networkId, networkMagic, ledgerPP, tracers) <- loadConfig
122+ (runtime, codecConfig, networkId, networkMagic, tracers) <- loadConfig
127123
128124 -- Launch.
129125 ----------
@@ -148,7 +144,7 @@ main = do
148144 replicateM
149145 (fromIntegral (inputsPerTx vb))
150146 (STM. readTQueue fundQueue)
151- case Tx. buildTx ledgerPP signingAddr signingKey
147+ case Tx. buildTx signingAddr signingKey
152148 inputFunds (outputsPerTx vb) (L. Coin (fee vb)) of
153149 Left err -> die $ " Tx.buildTx: " ++ err
154150 Right ans@ (tx, outputFunds) -> do
@@ -374,6 +370,23 @@ createSigningKeyAndAddress networkId n
374370 Api. NoStakeAddress
375371 in (signingKey, signingAddr)
376372
373+ --------------------------------------------------------------------------------
374+ -- Cardano parameters
375+ --------------------------------------------------------------------------------
376+
377+ {- - TODO: Construct a minimal protocol parameters, see Tx.hs last line.
378+ data ProtocolParameters = ProtocolParameters
379+ { epochLength :: Integer
380+ , minFeeA :: Integer
381+ , minFeeB :: Integer
382+ }
383+
384+ instance Aeson.FromJSON ProtocolParameters where
385+ parseJSON = Aeson.withObject "ProtocolParameters" $ \o -> do
386+ pp <- o .: "params"
387+ ProtocolParameters <$> pp .: "epoch_length" <*> pp .: "min_fee_a" <*> pp .: "min_fee_b"
388+ --}
389+
377390--------------------------------------------------------------------------------
378391-- Initialization
379392--------------------------------------------------------------------------------
@@ -392,8 +405,6 @@ loadConfig
392405 , Api. NetworkId
393406 -- | Network magic for the handshake with cardano-node.
394407 , Api. NetworkMagic
395- -- | Ledger protocol parameters for transaction building.
396- , Api. LedgerProtocolParameters Api. ConwayEra
397408 -- | Logging / metrics tracers.
398409 , Tracing. Tracers
399410 )
@@ -417,7 +428,6 @@ loadConfig = do
417428 Left err -> die $ " Config: " ++ err
418429 Right v -> pure v
419430 nodeConfigPath <- parseField " nodeConfig"
420- ppPath <- parseField " protocolParametersFile"
421431 raw <- case Aeson. fromJSON rawValue of
422432 Aeson. Error err -> die $ " JSON: " ++ err
423433 Aeson. Success cfg -> pure cfg
@@ -450,19 +460,10 @@ loadConfig = do
450460 networkId = protocolToNetworkId protocol
451461 networkMagic = protocolToNetworkMagic protocol
452462
453- -- Load protocol parameters.
454- hPutStrLn stderr $ " Loading protocol parameters from: " ++ ppPath
455- protocolParameters <-
456- Aeson. eitherDecodeFileStrict' ppPath >>= either die pure
457- ledgerPP <- case PP. convertToLedgerProtocolParameters
458- Api. ShelleyBasedEraConway protocolParameters of
459- Left err -> die $ " convertToLedgerProtocolParameters: " ++ show err
460- Right pp -> pure pp
461-
462463 -- Tracers.
463464 tracers <- Tracing. setupTracers configFile
464465
465- pure ( runtime, codecConfig, networkId, networkMagic, ledgerPP, tracers )
466+ pure ( runtime, codecConfig, networkId, networkMagic, tracers )
466467
467468--------------------------------------------------------------------------------
468469-- Protocol helpers (inlined from NodeConfig.hs and OuroborosImports.hs)
0 commit comments