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

Commit eb39160

Browse files
committed
Unify usage
only use direct import version of `utils.big_endian_to_int`
1 parent b296955 commit eb39160

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ethereum/blocks.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def __eq__(self, other):
332332
return isinstance(other, BlockHeader) and self.hash == other.hash
333333

334334
def __hash__(self):
335-
return utils.big_endian_to_int(self.hash)
335+
return big_endian_to_int(self.hash)
336336

337337
def __ne__(self, other):
338338
return not self.__eq__(other)
@@ -1099,7 +1099,7 @@ def account_to_dict(self, address, with_storage_root=False,
10991099
for kk in list(subcache.keys())]
11001100
for k in list(d.keys()) + subkeys:
11011101
v = d.get(k, None)
1102-
v2 = subcache.get(utils.big_endian_to_int(k), None)
1102+
v2 = subcache.get(big_endian_to_int(k), None)
11031103
hexkey = b'0x' + encode_hex(utils.zunpad(k))
11041104
if v2 is not None:
11051105
if v2 != 0:
@@ -1291,7 +1291,7 @@ def __eq__(self, other):
12911291
return isinstance(other, (Block, CachedBlock)) and self.hash == other.hash
12921292

12931293
def __hash__(self):
1294-
return utils.big_endian_to_int(self.hash)
1294+
return big_endian_to_int(self.hash)
12951295

12961296
def __ne__(self, other):
12971297
return not self.__eq__(other)
@@ -1349,7 +1349,7 @@ def commit_state(self):
13491349
pass
13501350

13511351
def __hash__(self):
1352-
return utils.big_endian_to_int(self.hash)
1352+
return big_endian_to_int(self.hash)
13531353

13541354
@property
13551355
def hash(self):
@@ -1437,8 +1437,8 @@ def genesis(env, **kwargs):
14371437
block.set_nonce(addr, utils.parse_int_or_hex(data['nonce']))
14381438
if 'storage' in data:
14391439
for k, v in data['storage'].items():
1440-
block.set_storage_data(addr, utils.big_endian_to_int(decode_hex(k[2:])),
1441-
utils.big_endian_to_int(decode_hex(v[2:])))
1440+
block.set_storage_data(addr, big_endian_to_int(decode_hex(k[2:])),
1441+
big_endian_to_int(decode_hex(v[2:])))
14421442
block.commit_state()
14431443
block.state.db.commit()
14441444
# genesis block has predefined state root (so no additional finalization

0 commit comments

Comments
 (0)