Skip to content

Commit 3e9e4bc

Browse files
committed
Add test and newsfragment for eth-tester key remappings #1630
1 parent 9ac13f9 commit 3e9e4bc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

newsfragments/1630.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ``eth-tester`` key remapping for ``logsBloom`` and ``receiptsRoot``
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
import pytest
22

3+
from web3.types import (
4+
BlockData,
5+
)
6+
37

48
@pytest.mark.parametrize("block_number", {0, "0x0", "earliest"})
59
def test_get_transaction_count_formatters(w3, block_number):
610
tx_counts = w3.eth.get_transaction_count(w3.eth.accounts[-1], block_number)
711
assert tx_counts == 0
12+
13+
14+
def test_get_block_formatters(w3):
15+
latest_block = w3.eth.get_block("latest")
16+
17+
all_block_keys = set(BlockData.__annotations__.keys())
18+
latest_block_keys = set(latest_block.keys())
19+
20+
keys_diff = all_block_keys.difference(latest_block_keys)
21+
assert len(keys_diff) == 1
22+
assert keys_diff.pop() == "mixHash" # mixHash is not implemented in eth-tester

0 commit comments

Comments
 (0)