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

Commit 5a1fc12

Browse files
committed
Workaround for issue #390
1 parent 025d43b commit 5a1fc12

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ethereum/testutils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def run_vm_test(params, mode, profiler=None):
141141
difficulty=parse_int_or_hex(env['currentDifficulty']),
142142
gas_limit=parse_int_or_hex(env['currentGasLimit']),
143143
timestamp=parse_int_or_hex(env['currentTimestamp']))
144+
144145
blk = blocks.Block(header, env=db_env)
145146

146147
# setup state
@@ -291,10 +292,14 @@ def run_state_test(params, mode):
291292
number=parse_int_or_hex(env['currentNumber']),
292293
coinbase=decode_hex(env['currentCoinbase']),
293294
difficulty=parse_int_or_hex(env['currentDifficulty']),
294-
gas_limit=parse_int_or_hex(env['currentGasLimit']),
295-
timestamp=parse_int_or_hex(env['currentTimestamp']))
295+
timestamp=parse_int_or_hex(env['currentTimestamp']),
296+
# work around https://github.com/ethereum/pyethereum/issues/390 [1]:
297+
gas_limit=min(2 ** 63 - 1, parse_int_or_hex(env['currentGasLimit'])))
296298
blk = blocks.Block(header, env=db_env)
297299

300+
# work around https://github.com/ethereum/pyethereum/issues/390 [2]:
301+
blk.gas_limit = parse_int_or_hex(env['currentGasLimit'])
302+
298303
# setup state
299304
for address, h in list(pre.items()):
300305
assert len(address) == 40

0 commit comments

Comments
 (0)