From 9ef000e529c0dc6af15f9199eb17c0992d8db1ef Mon Sep 17 00:00:00 2001 From: Victor Grau Serrat Date: Fri, 2 Feb 2018 12:06:57 -0700 Subject: [PATCH] BUG: balance returns different types --- catalyst/marketplace/marketplace.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/catalyst/marketplace/marketplace.py b/catalyst/marketplace/marketplace.py index a59d5ed7..828224ab 100644 --- a/catalyst/marketplace/marketplace.py +++ b/catalyst/marketplace/marketplace.py @@ -240,7 +240,10 @@ class Marketplace: address[2:]) }) - balance = int(balance[2:], 16) // 10 ** 8 + try: + balance = int(balance[2:], 16) // 10 ** 8 + except ValueError: + balance = int(bin_hex(balance), 16) // 10 ** 8 if balance > price: print('OK.')