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

Commit

Permalink
Merge pull request #386 from ethereum/more_py3_fixes
Browse files Browse the repository at this point in the history
More py3 fixes
  • Loading branch information
konradkonrad authored Jul 8, 2016
2 parents 7b27f4c + 2f26fe2 commit 989cd72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ethereum/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def _delta_item(self, address, param, value):
def mk_transaction_receipt(self, tx):
"""Create a receipt for a transaction."""
if self.number >= self.config["METROPOLIS_FORK_BLKNUM"]:
return Receipt('\x00' * 32, self.gas_used, self.logs)
return Receipt(b'\x00' * 32, self.gas_used, self.logs)
else:
return Receipt(self.state_root, self.gas_used, self.logs)

Expand Down
1 change: 1 addition & 0 deletions ethereum/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from rlp.utils import decode_hex

from ethereum import utils
from ethereum.db import BaseDB

Expand Down
12 changes: 8 additions & 4 deletions ethereum/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,15 @@ def blkhash(n):
compare_post_states(shouldbe, reallyis)
for k in ['pre', 'exec', 'env', 'callcreates',
'out', 'gas', 'logs', 'postStateRoot']:
shouldbe = params1.get(k, None)
reallyis = params2.get(k, None)
if shouldbe != reallyis:
_shouldbe = params1.get(k, None)
_reallyis = params2.get(k, None)
if _shouldbe != _reallyis:
print(('Mismatch {key}: shouldbe {shouldbe_key} != reallyis {reallyis_key}.\n'
'post: {shouldbe_post} != {reallyis_post}').format(
shouldbe_key=_shouldbe, reallyis_key=_reallyis,
shouldbe_post=shouldbe, reallyis_post=reallyis, key=k))
raise Exception("Mismatch: " + k + ':\n shouldbe %r\n reallyis %r' %
(shouldbe, reallyis))
(_shouldbe, _reallyis))

elif mode == TIME:
return time_post - time_pre
Expand Down

0 comments on commit 989cd72

Please sign in to comment.