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

Commit 500d1a7

Browse files
committed
Revert "simplify bytearray_to_bytestr"
This reverts commit 2c16c37.
1 parent 5d459b2 commit 500d1a7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ethereum/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def to_string_for_regexp(value):
3535
return str(value)
3636
unicode = unicode
3737

38+
def bytearray_to_bytestr(value):
39+
return bytes(''.join(chr(c) for c in value))
40+
3841
else:
3942
is_numeric = lambda x: isinstance(x, int)
4043
is_string = lambda x: isinstance(x, bytes)
@@ -56,14 +59,12 @@ def to_string_for_regexp(value):
5659
return str(to_string(value), 'utf-8')
5760
unicode = str
5861

62+
def bytearray_to_bytestr(value):
63+
return bytes(value)
5964

6065
isnumeric = is_numeric
6166

6267

63-
def bytearray_to_bytestr(value):
64-
return bytes(value)
65-
66-
6768
def mk_contract_address(sender, nonce):
6869
return sha3(rlp.encode([normalize_address(sender), nonce]))[12:]
6970

0 commit comments

Comments
 (0)