Skip to content

Commit a1d08ff

Browse files
committed
WIP
1 parent 0e8ce64 commit a1d08ff

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/json-fixtures/test_state.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,13 @@ def test_state_fixtures(fixture, fixture_vm_class):
327327
receipts = vm.block.get_receipts(chaindb) + (receipt, )
328328
block = vm.set_block_transactions(vm.block, header, transactions, receipts)
329329
except ValidationError as err:
330-
state.account_db.set_balance(vm.block.header.coinbase, 0)
331-
state.account_db.persist()
332-
vm.block = vm.block.copy(header=vm.block.header.copy(state_root=state.state_root))
330+
# This feels terribly wrong
331+
coinbase_balance = state.account_db.get_balance(vm.block.header.coinbase)
332+
if coinbase_balance == 0:
333+
state.account_db.set_balance(vm.block.header.coinbase, 0)
334+
state.account_db.persist()
335+
vm.block = vm.block.copy(header=vm.block.header.copy(state_root=state.state_root))
336+
333337
block = vm.block
334338
transaction_error = err
335339
logger.warning("Got transaction error", exc_info=True)

0 commit comments

Comments
 (0)