Skip to content

Commit f80381f

Browse files
committed
Change how failing tx are handled in state tests
1 parent d528154 commit f80381f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

eth/tools/fixtures/normalization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def normalize_bytes(value):
7171
return value
7272
elif is_text(value) and is_hex(value):
7373
return decode_hex(value)
74+
elif is_text(value):
75+
return b''
7476
else:
7577
raise TypeError("Value must be either a string or bytes object")
7678

tests/json-fixtures/test_state.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ 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))
330333
block = vm.block
331334
transaction_error = err
332335
logger.warning("Got transaction error", exc_info=True)

0 commit comments

Comments
 (0)