Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 23ea125

Browse files
author
Jan Xie
committed
fix hash value encoding in abi
1 parent fb73b38 commit 23ea125

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ethereum/abi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ def encode_single(typ, arg):
221221
raise EncodingError("too long: %r" % arg)
222222
if isnumeric(arg):
223223
return zpad(encode_int(arg), 32)
224-
elif len(arg) == len(sub):
224+
elif len(arg) == int(sub):
225225
return zpad(arg, 32)
226-
elif len(arg) == len(sub) * 2:
226+
elif len(arg) == int(sub) * 2:
227227
return zpad(decode_hex(arg), 32)
228228
else:
229229
raise EncodingError("Could not parse hash: %r" % arg)

0 commit comments

Comments
 (0)