@@ -7,7 +7,7 @@ module BotPlutusInterface.Balance (
77) where
88
99import BotPlutusInterface.CardanoCLI qualified as CardanoCLI
10- import BotPlutusInterface.Effects (PABEffect , createDirectoryIfMissingCLI , printLog )
10+ import BotPlutusInterface.Effects (PABEffect , createDirectoryIfMissingCLI , printBpiLog )
1111import BotPlutusInterface.Files (DummyPrivKey , unDummyPrivateKey )
1212import BotPlutusInterface.Files qualified as Files
1313import BotPlutusInterface.Types (LogLevel (Debug ), PABConfig )
@@ -60,6 +60,7 @@ import Plutus.V1.Ledger.Api (
6060 )
6161
6262import BotPlutusInterface.BodyBuilder qualified as BodyBuilder
63+ import Prettyprinter (pretty , viaShow , (<+>) )
6364import Prelude
6465
6566{- | Collect necessary tx inputs and collaterals, add minimum lovelace values and balance non ada
@@ -86,7 +87,7 @@ balanceTxIO pabConf ownPkh unbalancedTx =
8687 (unBalancedTxValidityTimeRange unbalancedTx)
8788 (unBalancedTxTx unbalancedTx)
8889
89- lift $ printLog @ w Debug $ show utxoIndex
90+ lift $ printBpiLog @ w Debug $ viaShow utxoIndex
9091
9192 -- We need this folder on the CLI machine, which may not be the local machine
9293 lift $ createDirectoryIfMissingCLI @ w False (Text. unpack pabConf. pcTxFileDir)
@@ -130,7 +131,7 @@ balanceTxIO pabConf ownPkh unbalancedTx =
130131
131132 let minUtxos = prevMinUtxos ++ nextMinUtxos
132133
133- lift $ printLog @ w Debug $ " Min utxos: " ++ show minUtxos
134+ lift $ printBpiLog @ w Debug $ " Min utxos:" <+> pretty minUtxos
134135
135136 -- Calculate fees by pre-balancing the tx, building it, and running the CLI on result
136137 txWithoutFees <-
@@ -142,7 +143,7 @@ balanceTxIO pabConf ownPkh unbalancedTx =
142143
143144 let fees = nonBudgettedFees + getBudgetPrice (getExecutionUnitPrices pabConf) exBudget
144145
145- lift $ printLog @ w Debug $ " Fees: " ++ show fees
146+ lift $ printBpiLog @ w Debug $ " Fees:" <+> pretty fees
146147
147148 -- Rebalance the initial tx with the above fees
148149 balancedTx <- hoistEither $ balanceTxStep minUtxos utxoIndex changeAddr $ tx `withFee` fees
0 commit comments