@@ -35,6 +35,7 @@ import BotPlutusInterface.Types (
3535 CollateralUtxo (CollateralUtxo ),
3636 ContractEnvironment (.. ),
3737 LogLevel (Debug , Notice , Warn ),
38+ LogType (CollateralLog , PABLog ),
3839 Tip (block , slot ),
3940 TxFile (Signed ),
4041 collateralValue ,
@@ -174,7 +175,7 @@ handlePABReq ::
174175 PABReq ->
175176 Eff effs PABResp
176177handlePABReq contractEnv req = do
177- printBpiLog @ w Debug $ pretty req
178+ printBpiLog @ w ( Debug [ PABLog ]) $ pretty req
178179 resp <- case req of
179180 ----------------------
180181 -- Handled requests --
@@ -208,7 +209,7 @@ handlePABReq contractEnv req = do
208209 -- YieldUnbalancedTxReq UnbalancedTx
209210 unsupported -> error (" Unsupported PAB effect: " ++ show unsupported)
210211
211- printBpiLog @ w Debug $ pretty resp
212+ printBpiLog @ w ( Debug [ PABLog ]) $ pretty resp
212213 pure resp
213214
214215{- | Await till transaction status change to something from `Unknown`.
@@ -227,7 +228,7 @@ awaitTxStatusChange ::
227228 Eff effs TxStatus
228229awaitTxStatusChange contractEnv txId = do
229230 checkStartedBlock <- currentBlock contractEnv
230- printBpiLog @ w Debug $ pretty $ " Awaiting status change for " ++ show txId
231+ printBpiLog @ w ( Debug [ PABLog ]) $ pretty $ " Awaiting status change for " ++ show txId
231232
232233 let txStatusPolling = contractEnv. cePABConfig. pcTxStatusPolling
233234 pollInterval = fromIntegral $ txStatusPolling. spInterval
@@ -276,7 +277,7 @@ awaitTxStatusChange contractEnv txId = do
276277 pure . Just $ fromTx blk tx
277278 Nothing -> pure Nothing
278279
279- logDebug = printBpiLog @ w Debug . pretty
280+ logDebug = printBpiLog @ w ( Debug [ PABLog ]) . pretty
280281
281282-- | This will FULLY balance a transaction
282283balanceTx ::
@@ -344,7 +345,7 @@ writeBalancedTx contractEnv (Right tx) = do
344345 if signable
345346 then newEitherT $ CardanoCLI. signTx @ w pabConf tx requiredSigners
346347 else
347- lift . printBpiLog @ w Warn . PP. vsep $
348+ lift . printBpiLog @ w ( Warn [ PABLog ]) . PP. vsep $
348349 [ " Not all required signatures have signing key files. Please sign and submit the tx manually:"
349350 , " Tx file:" <+> pretty (Files. txFilePath pabConf " raw" (Tx. txId tx))
350351 , " Signatories (pkh):" <+> pretty (Text. unwords (map pkhToText requiredSigners))
@@ -482,12 +483,12 @@ handleCollateral cEnv = do
482483 case result of
483484 Right collteralUtxo ->
484485 setInMemCollateral @ w collteralUtxo
485- >> Right <$> printBpiLog @ w Debug " successfully set the collateral utxo in env."
486+ >> Right <$> printBpiLog @ w ( Debug [ CollateralLog ]) " successfully set the collateral utxo in env."
486487 Left err -> pure $ Left $ " Failed to make collateral: " <> err
487488 where
488489 --
489490 helperLog :: PP. Doc () -> ExceptT CollateralUtxo (Eff effs ) ()
490- helperLog msg = newEitherT $ Right <$> printBpiLog @ w Debug msg
491+ helperLog msg = newEitherT $ Right <$> printBpiLog @ w ( Debug [ CollateralLog ]) msg
491492
492493{- | Create collateral UTxO by submitting Tx.
493494 Then try to find created UTxO at own PKH address.
@@ -498,7 +499,7 @@ makeCollateral ::
498499 ContractEnvironment w ->
499500 Eff effs (Either Text CollateralUtxo )
500501makeCollateral cEnv = runEitherT $ do
501- lift $ printBpiLog @ w Notice " Making collateral"
502+ lift $ printBpiLog @ w ( Notice [ CollateralLog ]) " Making collateral"
502503
503504 let pabConf = cEnv. cePABConfig
504505 unbalancedTx <-
@@ -517,7 +518,7 @@ makeCollateral cEnv = runEitherT $ do
517518 WriteBalancedTxFailed e -> throwE . T. pack $ " Failed to create collateral output: " <> show e
518519 WriteBalancedTxSuccess cTx -> do
519520 status <- lift $ awaitTxStatusChange cEnv (getCardanoTxId cTx)
520- lift $ printBpiLog @ w Notice $ " Collateral Tx Status: " <> pretty status
521+ lift $ printBpiLog @ w ( Notice [ CollateralLog ]) $ " Collateral Tx Status: " <> pretty status
521522 newEitherT $ findCollateralAtOwnPKH cEnv
522523
523524-- | Finds a collateral present at user's address
0 commit comments