From 14540ffb077e2152b27e88b41c63aa3f8d0a7f7e Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Mon, 1 Jul 2024 14:35:34 -0500 Subject: [PATCH] Add debugging --- src/ZGoBackend.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index ef88e2e..d1555a3 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -2028,8 +2028,8 @@ scanTxNative config pipe = do if isValidSaplingViewingKey (E.encodeUtf8 $ oviewkey k) then do print "decoding Sapling tx" - let decodedSapList' = concatMap (decodeSaplingTx $ oviewkey k) txList' - let zList = catMaybes decodedSapList' + decodedSapList' <- mapM (decodeSaplingTx $ oviewkey k) txList' + let zList = concatMap catMaybes decodedSapList' mapM_ (recordPayment pipe (c_dbName config) (oaddress k)) zList else do let vk = decodeUfvk $ E.encodeUtf8 $ oviewkey k @@ -2043,12 +2043,14 @@ scanTxNative config pipe = do let decodedOrchList = concatMap (decodeUnifiedOrchardTx v) txList' let oList = catMaybes decodedOrchList mapM_ (recordPayment pipe (c_dbName config) (oaddress k)) oList - decodeSaplingTx :: T.Text -> RawTxResponse -> [Maybe ZcashTx] - decodeSaplingTx k t = - map - (buildZcashTx t . - decodeSaplingOutput (bytes (decodeBech32 $ E.encodeUtf8 k))) - (rt_shieldedOutputs t) + decodeSaplingTx :: T.Text -> RawTxResponse -> IO [Maybe ZcashTx] + decodeSaplingTx k t = do + print (show t) + return $ + map + (buildZcashTx t . + decodeSaplingOutput (bytes (decodeBech32 $ E.encodeUtf8 k))) + (rt_shieldedOutputs t) decodeUnifiedSaplingTx :: BS.ByteString -> RawTxResponse -> [Maybe ZcashTx] decodeUnifiedSaplingTx k t = map (buildZcashTx t . decodeSaplingOutput k) (rt_shieldedOutputs t)