From 88d3cfba303eeb257b8bc5a8135c586713e234d5 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 30 Dec 2021 14:15:07 +0000 Subject: [PATCH] Add debug code in Transactions --- handler/transactions.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index 06c6ffe..ccdac5b 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -79,18 +79,14 @@ class Transactions(object): self.irc.client.channel, f"AUTO Incoming transaction: {amount}{currency} ({reference}) - {state} - {description}" ) # Try getting the trade by the reference ID given + print("REFERENCE", reference) stored_trade = self.get_ref(reference) + print(f"STORED_TRADE {stored_trade}") if not stored_trade: + print(f"NOT STORED TRADE {reference}") self.log.info(f"No reference in DB for {reference}", reference=reference) self.irc.client.msg(self.irc.client.channel, f"No reference in DB for {reference}") - # Try getting the trade by the reference, using it as a TXID - ref2 = self.tx_to_ref(reference) - if not ref2: - self.log.info("No TXID in DB for {reference}", reference=reference) - self.irc.client.msg(self.irc.client.channel, f"No TXID in DB for {reference}") return - else: - reference = ref2 amount = float(amount) stored_trade["amount"] = float(stored_trade["amount"]) @@ -202,7 +198,10 @@ class Transactions(object): :return: trade ID :rtype: string """ - ref_data = convert(r.hgetall(f"trade.{reference}")) + ref_data = r.hgetall(f"trade.{reference}") + print(f"RETURN FROM GET_REF() {ref_data}") + ref_data = convert(ref_data) + print(f"CONVERTED IN GET_REF() {ref_data}") if not ref_data: return False return ref_data