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

Commit 2c16c37

Browse files
committed
simplify bytearray_to_bytestr
1 parent 20537b9 commit 2c16c37

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ethereum/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ 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-
4138
else:
4239
is_numeric = lambda x: isinstance(x, int)
4340
is_string = lambda x: isinstance(x, bytes)
@@ -59,12 +56,14 @@ def to_string_for_regexp(value):
5956
return str(to_string(value), 'utf-8')
6057
unicode = str
6158

62-
def bytearray_to_bytestr(value):
63-
return bytes(value)
6459

6560
isnumeric = is_numeric
6661

6762

63+
def bytearray_to_bytestr(value):
64+
return bytes(value)
65+
66+
6867
def mk_contract_address(sender, nonce):
6968
return sha3(rlp.encode([normalize_address(sender), nonce]))[12:]
7069

0 commit comments

Comments
 (0)