Add debug code in Transactions
This commit is contained in:
parent
44d997ea20
commit
88d3cfba30
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue