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

Commit 989cd72

Browse files
authored
Merge pull request #386 from ethereum/more_py3_fixes
More py3 fixes
2 parents 7b27f4c + 2f26fe2 commit 989cd72

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ethereum/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def _delta_item(self, address, param, value):
792792
def mk_transaction_receipt(self, tx):
793793
"""Create a receipt for a transaction."""
794794
if self.number >= self.config["METROPOLIS_FORK_BLKNUM"]:
795-
return Receipt('\x00' * 32, self.gas_used, self.logs)
795+
return Receipt(b'\x00' * 32, self.gas_used, self.logs)
796796
else:
797797
return Receipt(self.state_root, self.gas_used, self.logs)
798798

ethereum/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from rlp.utils import decode_hex
2+
23
from ethereum import utils
34
from ethereum.db import BaseDB
45

ethereum/testutils.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,15 @@ def blkhash(n):
389389
compare_post_states(shouldbe, reallyis)
390390
for k in ['pre', 'exec', 'env', 'callcreates',
391391
'out', 'gas', 'logs', 'postStateRoot']:
392-
shouldbe = params1.get(k, None)
393-
reallyis = params2.get(k, None)
394-
if shouldbe != reallyis:
392+
_shouldbe = params1.get(k, None)
393+
_reallyis = params2.get(k, None)
394+
if _shouldbe != _reallyis:
395+
print(('Mismatch {key}: shouldbe {shouldbe_key} != reallyis {reallyis_key}.\n'
396+
'post: {shouldbe_post} != {reallyis_post}').format(
397+
shouldbe_key=_shouldbe, reallyis_key=_reallyis,
398+
shouldbe_post=shouldbe, reallyis_post=reallyis, key=k))
395399
raise Exception("Mismatch: " + k + ':\n shouldbe %r\n reallyis %r' %
396-
(shouldbe, reallyis))
400+
(_shouldbe, _reallyis))
397401

398402
elif mode == TIME:
399403
return time_post - time_pre

0 commit comments

Comments
 (0)