commit d5f19248da36d49c3146b0b3bbebac8a16b6b075
parent e457275128a7034b141f5fca56db035b11d95fd3
Author: lash <dev@holbrook.no>
Date:   Sat, 12 Mar 2022 14:19:56 +0000
handle strings in tx inputs in test token cache tx object
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/common.py b/tests/common.py
@@ -50,7 +50,10 @@ class MockCacheTokenTx(CacheTokenTx):
 
     def deserialize(self, signed_tx):
         h = hashlib.sha1()
-        h.update(signed_tx + b'\x01')
+        try:
+            h.update(signed_tx + b'\x01')
+        except TypeError:
+            h.update(signed_tx.encode('utf-8') + b'\x01')
         z = h.digest()
         nonce = int.from_bytes(z[:4], 'big')
         token_value = int.from_bytes(z[4:8], 'big')