From e3d3595efd5d39b11909e14cb10a7823250d6b4a Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 14 Mar 2022 20:55:52 +0000 Subject: [PATCH] Add extra tests for transactions fields --- handler/transactions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handler/transactions.py b/handler/transactions.py index 5ac8678..65973d4 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -78,6 +78,10 @@ class Transactions(util.Base): ts = data["timestamp"] txid = data["transaction_id"] txtype = data["transaction_type"] + if "amount" not in data: + return + if "currency" not in data: + return amount = data["amount"] if amount <= 0: self.log.info(f"Ignoring transaction with negative/zero amount: {txid}") @@ -189,7 +193,7 @@ class Transactions(util.Base): # Parse the escrow release response message = rtrn["message"] - #message_long = rtrn["response"]["data"]["message"] + # message_long = rtrn["response"]["data"]["message"] self.irc.sendmsg(f"{dumps(message)}") def new_trade(self, asset, trade_id, buyer, currency, amount, amount_crypto, provider):