From 468699222f22e26f08936a03e95a284ae6de4395 Mon Sep 17 00:00:00 2001 From: Jamie Bertram Date: Tue, 26 Sep 2023 16:22:38 -0400 Subject: [PATCH] Fix partial record selector usage --- .../Language/Marlowe/CLI/Command/Run.hs | 54 ++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/marlowe-cli/command/Language/Marlowe/CLI/Command/Run.hs b/marlowe-cli/command/Language/Marlowe/CLI/Command/Run.hs index 5e1805a79a..7027ef8aa1 100644 --- a/marlowe-cli/command/Language/Marlowe/CLI/Command/Run.hs +++ b/marlowe-cli/command/Language/Marlowe/CLI/Command/Run.hs @@ -267,20 +267,20 @@ runRunCommand runRunCommand command = do let network' = network command - connection = - LocalNodeConnectInfo - { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 - , localNodeNetworkId = network' - , localNodeSocketPath = File $ socketPath command - } marloweParams' = maybe defaultMarloweParams marloweParams $ rolesCurrency command stake' = fromMaybe NoStakeAddress $ stake command printTxId = liftIO . putStrLn . ("TxId " <>) . show padTxOut (address, value) = (address, C.TxOutDatumNone, value) outputs' = padTxOut <$> outputs command - costModel <- getPV2CostModelParams (QueryNode connection) case command of Initialize{..} -> do + let connection = + LocalNodeConnectInfo + { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 + , localNodeNetworkId = network' + , localNodeSocketPath = File socketPath + } + costModel <- getPV2CostModelParams (QueryNode connection) slotConfig <- querySlotConfig connection protocolVersion <- getProtocolVersion (QueryNode connection) initializeTransaction @@ -305,7 +305,13 @@ runRunCommand command = maximumTime outputFile printStats - Run{..} -> + Run{..} -> do + let connection = + LocalNodeConnectInfo + { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 + , localNodeNetworkId = network' + , localNodeSocketPath = File socketPath + } runTransaction connection marloweIn @@ -320,7 +326,13 @@ runRunCommand command = printStats invalid >>= printTxId - Withdraw{..} -> + Withdraw{..} -> do + let connection = + LocalNodeConnectInfo + { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 + , localNodeNetworkId = network' + , localNodeSocketPath = File socketPath + } withdrawFunds connection marloweOut @@ -336,7 +348,13 @@ runRunCommand command = printStats invalid >>= printTxId - AutoRun{..} -> + AutoRun{..} -> do + let connection = + LocalNodeConnectInfo + { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 + , localNodeNetworkId = network' + , localNodeSocketPath = File socketPath + } autoRunTransaction connection marloweIn' @@ -349,7 +367,13 @@ runRunCommand command = printStats invalid >>= printTxId - AutoWithdraw{..} -> + AutoWithdraw{..} -> do + let connection = + LocalNodeConnectInfo + { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 + , localNodeNetworkId = network' + , localNodeSocketPath = File socketPath + } autoWithdrawFunds connection marloweOut @@ -362,7 +386,13 @@ runRunCommand command = (PrintStats printStats) invalid >>= printTxId - Analyze{..} -> + Analyze{..} -> do + let connection = + LocalNodeConnectInfo + { localConsensusModeParams = CardanoModeParams $ EpochSlots 21600 + , localNodeNetworkId = network' + , localNodeSocketPath = File socketPath + } analyze connection marloweOut