handle strings in tx inputs in test token cache tx object
This commit is contained in:
parent
e457275128
commit
d5f19248da
@ -50,7 +50,10 @@ class MockCacheTokenTx(CacheTokenTx):
|
|||||||
|
|
||||||
def deserialize(self, signed_tx):
|
def deserialize(self, signed_tx):
|
||||||
h = hashlib.sha1()
|
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()
|
z = h.digest()
|
||||||
nonce = int.from_bytes(z[:4], 'big')
|
nonce = int.from_bytes(z[:4], 'big')
|
||||||
token_value = int.from_bytes(z[4:8], 'big')
|
token_value = int.from_bytes(z[4:8], 'big')
|
||||||
|
Loading…
Reference in New Issue
Block a user