Skip to content

Commit

Permalink
Add mix_hash to the BLOCK_RESULTS_KEY_MAPPING from eth-tester
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Dec 16, 2022
1 parent 3907e17 commit 4aac916
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions tests/core/middleware/test_eth_tester_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ def test_get_block_formatters(w3):
all_block_keys = set(BlockData.__annotations__.keys())
latest_block_keys = set(latest_block.keys())

keys_diff = all_block_keys.difference(latest_block_keys)
assert len(keys_diff) == 2
# mixHash and miner not implemented in eth-tester
assert keys_diff == set(["mixHash", "miner"])
assert all_block_keys == latest_block_keys


@pytest.mark.parametrize(
Expand Down
1 change: 1 addition & 0 deletions web3/providers/eth_tester/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def is_hexstr(value: Any) -> bool:
"extra_data": "extraData",
"gas_used": "gasUsed",
"base_fee_per_gas": "baseFeePerGas",
"mix_hash": "mixHash",
# eth-tester changed the miner key to coinbase since
# there is no longer any mining happening, but the current
# JSON-RPC spec still says miner
Expand Down

0 comments on commit 4aac916

Please sign in to comment.