@@ -175,7 +175,7 @@ handlePABReq ::
175175 PABReq ->
176176 Eff effs PABResp
177177handlePABReq contractEnv req = do
178- printBpiLog @ w (Debug PABLog ) $ pretty req
178+ printBpiLog @ w (Debug [ PABLog ] ) $ pretty req
179179 resp <- case req of
180180 ----------------------
181181 -- Handled requests --
@@ -209,7 +209,7 @@ handlePABReq contractEnv req = do
209209 -- YieldUnbalancedTxReq UnbalancedTx
210210 unsupported -> error (" Unsupported PAB effect: " ++ show unsupported)
211211
212- printBpiLog @ w (Debug PABLog ) $ pretty resp
212+ printBpiLog @ w (Debug [ PABLog ] ) $ pretty resp
213213 pure resp
214214
215215{- | Await till transaction status change to something from `Unknown`.
@@ -228,7 +228,7 @@ awaitTxStatusChange ::
228228 Eff effs TxStatus
229229awaitTxStatusChange contractEnv txId = do
230230 checkStartedBlock <- currentBlock contractEnv
231- printBpiLog @ w (Debug PABLog ) $ pretty $ " Awaiting status change for " ++ show txId
231+ printBpiLog @ w (Debug [ PABLog ] ) $ pretty $ " Awaiting status change for " ++ show txId
232232
233233 let txStatusPolling = contractEnv. cePABConfig. pcTxStatusPolling
234234 pollInterval = fromIntegral $ txStatusPolling. spInterval
@@ -240,7 +240,7 @@ awaitTxStatusChange contractEnv txId = do
240240 txStatus <- getStatus
241241 case (txStatus, currBlock > cutOffBlock) of
242242 (status, True ) -> do
243- helperLog (Debug PABLog ) . mconcat . fmap mconcat $
243+ helperLog (Debug [ PABLog ] ) . mconcat . fmap mconcat $
244244 [ [" Timeout for waiting `TxId " , show txId, " ` status change reached" ]
245245 , [" - waited " , show pollTimeout, " blocks." ]
246246 , [" Current status: " , show status]
@@ -255,17 +255,17 @@ awaitTxStatusChange contractEnv txId = do
255255 mTx <- queryChainIndexForTxState
256256 case mTx of
257257 Nothing -> do
258- helperLog (Debug PABLog ) $ " TxId " ++ show txId ++ " not found in index"
258+ helperLog (Debug [ PABLog ] ) $ " TxId " ++ show txId ++ " not found in index"
259259 pure Unknown
260260 Just txState -> do
261- helperLog (Debug PABLog ) $ " TxId " ++ show txId ++ " found in index, checking status"
261+ helperLog (Debug [ PABLog ] ) $ " TxId " ++ show txId ++ " found in index, checking status"
262262 blk <- fromInteger <$> currentBlock contractEnv
263263 case transactionStatus blk txState txId of
264264 Left e -> do
265- helperLog (Debug PABLog ) $ " Status check for TxId " ++ show txId ++ " failed with " ++ show e
265+ helperLog (Debug [ PABLog ] ) $ " Status check for TxId " ++ show txId ++ " failed with " ++ show e
266266 pure Unknown
267267 Right st -> do
268- helperLog (Debug PABLog ) $ " Status for TxId " ++ show txId ++ " is " ++ show st
268+ helperLog (Debug [ PABLog ] ) $ " Status for TxId " ++ show txId ++ " is " ++ show st
269269 pure st
270270
271271 queryChainIndexForTxState :: Eff effs (Maybe TxIdState )
@@ -346,7 +346,7 @@ writeBalancedTx contractEnv (Right tx) = do
346346 if signable
347347 then newEitherT $ CardanoCLI. signTx @ w pabConf tx requiredSigners
348348 else
349- lift . printBpiLog @ w Warn . PP. vsep $
349+ lift . printBpiLog @ w ( Warn [ PABLog ]) . PP. vsep $
350350 [ " Not all required signatures have signing key files. Please sign and submit the tx manually:"
351351 , " Tx file:" <+> pretty (Files. txFilePath pabConf " raw" (Tx. txId tx))
352352 , " Signatories (pkh):" <+> pretty (Text. unwords (map pkhToText requiredSigners))
@@ -485,12 +485,12 @@ handleCollateral cEnv = do
485485 case result of
486486 Right collteralUtxo ->
487487 setInMemCollateral @ w collteralUtxo
488- >> Right <$> printBpiLog @ w (Debug PABLog ) " successfully set the collateral utxo in env."
488+ >> Right <$> printBpiLog @ w (Debug [ PABLog ] ) " successfully set the collateral utxo in env."
489489 Left err -> pure $ Left $ " Failed to make collateral: " <> err
490490 where
491491 --
492492 helperLog :: PP. Doc () -> ExceptT CollateralUtxo (Eff effs ) ()
493- helperLog msg = newEitherT $ Right <$> printBpiLog @ w (Debug CollateralLog ) msg
493+ helperLog msg = newEitherT $ Right <$> printBpiLog @ w (Debug [ CollateralLog ] ) msg
494494
495495{- | Create collateral UTxO by submitting Tx.
496496 Then try to find created UTxO at own PKH address.
@@ -501,7 +501,7 @@ makeCollateral ::
501501 ContractEnvironment w ->
502502 Eff effs (Either Text CollateralUtxo )
503503makeCollateral cEnv = runEitherT $ do
504- lift $ printBpiLog @ w Notice " Making collateral"
504+ lift $ printBpiLog @ w ( Notice [ CollateralLog ]) " Making collateral"
505505
506506 let pabConf = cEnv. cePABConfig
507507 unbalancedTx <-
@@ -520,7 +520,7 @@ makeCollateral cEnv = runEitherT $ do
520520 WriteBalancedTxFailed e -> throwE . T. pack $ " Failed to create collateral output: " <> show e
521521 WriteBalancedTxSuccess cTx -> do
522522 status <- lift $ awaitTxStatusChange cEnv (getCardanoTxId cTx)
523- lift $ printBpiLog @ w Notice $ " Collateral Tx Status: " <> pretty status
523+ lift $ printBpiLog @ w ( Notice [ CollateralLog ]) $ " Collateral Tx Status: " <> pretty status
524524 newEitherT $ findCollateralAtOwnPKH cEnv
525525
526526-- | Finds a collateral present at user's address
0 commit comments