From 18e3e4bcf093097135e2c82c1540125df7e37b07 Mon Sep 17 00:00:00 2001 From: Franco Testagrossa Date: Wed, 3 Apr 2024 19:25:03 +0200 Subject: [PATCH] Add debug points --- hydra-cluster/src/Hydra/Cluster/Faucet.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hydra-cluster/src/Hydra/Cluster/Faucet.hs b/hydra-cluster/src/Hydra/Cluster/Faucet.hs index 11983f8ba1c..eabf50b7b2d 100644 --- a/hydra-cluster/src/Hydra/Cluster/Faucet.hs +++ b/hydra-cluster/src/Hydra/Cluster/Faucet.hs @@ -112,15 +112,20 @@ returnFundsToFaucet tracer node@RunningNode{networkId, nodeSocket} sender = do (senderVk, senderSk) <- keysFor sender utxo <- queryUTxOFor networkId nodeSocket QueryTip senderVk + traceShowM ("RemainingFunds utxo:" <> renderUTxO utxo) retryOnExceptions tracer $ do let utxoValue = balance @Tx utxo let allLovelace = selectLovelace utxoValue + traceShowM ("allLovelace:" <> show allLovelace) -- select tokens other than ADA here so we can burn it afterwards let otherTokens = filterValue (/= AdaAssetId) utxoValue + traceShowM ("otherTokens:" <> renderValue otherTokens) -- XXX: Using a hard-coded high-enough value to satisfy the min utxo value. -- NOTE: We use the faucet address as the change deliberately here. fee <- calculateTxFee node senderSk utxo faucetAddress 1_500_000 + traceShowM ("fee:" <> show fee) let returnBalance = allLovelace - fee + traceShowM ("returnBalance:" <> show returnBalance) tx <- sign senderSk <$> buildTxBody utxo faucetAddress returnBalance otherTokens submitTransaction networkId nodeSocket tx void $ awaitTransaction networkId nodeSocket tx