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

Commit 84af5ba

Browse files
committed
Make cool_checksum py3 compatible
1 parent 586e53b commit 84af5ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ethereum/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ def add_cool_checksum(addr):
142142

143143
o = ''
144144
h = encode_hex(sha3(addr_hex))
145+
if not isinstance(addr_hex, str):
146+
# py3 bytes sequence
147+
addr_hex = list(chr(c) for c in addr_hex)
148+
h = list(chr(c) for c in h)
149+
145150
for i, c in enumerate(addr_hex):
146151
if c in '0123456789':
147152
o += c

0 commit comments

Comments
 (0)