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

Commit 2f26fe2

Browse files
pipermerriamkonradkonrad
authored andcommitted
fix errors
cherry-picked 25a026f Also add some more detailed information in failed verification cases (testutils). Conflicts: ethereum/blocks.py ethereum/config.py ethereum/processblock.py ethereum/testutils.py
1 parent 67196d4 commit 2f26fe2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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)