Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove td field #3532

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ to interact with the Ethereum blockchain. Try getting all the information about
'size': 622,
'stateRoot': HexBytes('0x1f5e460eb84dc0606ab74189dbcfe617300549f8f4778c3c9081c119b5b5d1c1'),
'timestamp': 0,
'totalDifficulty': 1,
'transactions': [],
'transactionsRoot': HexBytes('0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'),
'uncles': []}
Expand Down
2 changes: 0 additions & 2 deletions docs/web3.eth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ The following methods are available on the ``web3.eth`` namespace.
'size': 650,
'stateRoot': '0x96dbad955b166f5119793815c36f11ffa909859bbfeb64b735cca37cbf10bef1',
'timestamp': 1470173578,
'totalDifficulty': 44010101827705409388,
'transactions': ['0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef'],
'transactionsRoot': '0xb31f174d27b99cdae8e746bd138a01ce60d8dd7b224f7c60845914def05ecc58',
'uncles': [],
Expand Down Expand Up @@ -416,7 +415,6 @@ The following methods are available on the ``web3.eth`` namespace.
'sha3Uncles': '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
'size': None, 'stateRoot': '0x8ce2b1bf8e25a06a8ca34c647ff5fd0fa48ac725cc07f657ae1645ab8ef68c91',
'timestamp': '0x55c6a972',
'totalDifficulty': '0xce4c4f0a0b810b',
'transactions': [],
'transactionsRoot': '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
'uncles': []
Expand Down
1 change: 1 addition & 0 deletions newsfragments/3502.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remove ``totalDifficulty`` field
3 changes: 0 additions & 3 deletions tests/core/eth-module/test_block_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_get_block_formatters_with_null_values(w3, request_mocker):
"difficulty": None,
"receiptsRoot": None,
"stateRoot": None,
"totalDifficulty": None,
"transactionsRoot": None,
"transactions": [],
"withdrawalsRoot": None,
Expand Down Expand Up @@ -79,7 +78,6 @@ def test_get_block_formatters_with_pre_formatted_values(w3, request_mocker):
"stateRoot": (
"0xfeed54faf6bb151112970b460118ed790197d69df7fcdd79801d120851723c88"
),
"totalDifficulty": "0x9bf9a3",
"transactionsRoot": (
"0xafeedbeef5f30efc9baf28e49271302e9b569cfa1e8e9d9512360eb8e7c667a7"
),
Expand Down Expand Up @@ -134,7 +132,6 @@ def test_get_block_formatters_with_pre_formatted_values(w3, request_mocker):
"difficulty": int(unformatted_values_block["difficulty"], 16),
"receiptsRoot": HexBytes(unformatted_values_block["receiptsRoot"]),
"stateRoot": HexBytes(unformatted_values_block["stateRoot"]),
"totalDifficulty": int(unformatted_values_block["totalDifficulty"], 16),
"transactionsRoot": HexBytes(unformatted_values_block["transactionsRoot"]),
"transactions": [
HexBytes(unformatted_values_block["transactions"][0]),
Expand Down
1 change: 0 additions & 1 deletion web3/_utils/method_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ def storage_key_to_hexstr(value: Union[bytes, int, str]) -> HexStr:
"difficulty": to_integer_if_hex,
"receiptsRoot": apply_formatter_if(is_not_null, to_hexbytes(32)),
"stateRoot": apply_formatter_if(is_not_null, to_hexbytes(32)),
"totalDifficulty": to_integer_if_hex,
"transactions": apply_one_of_formatters(
(
(
Expand Down
1 change: 0 additions & 1 deletion web3/providers/eth_tester/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def is_hexstr(value: Any) -> bool:
"logs_bloom": "logsBloom",
"state_root": "stateRoot",
"receipts_root": "receiptsRoot",
"total_difficulty": "totalDifficulty",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd want to remove this in eth-tester before removing it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no one is against it, I can open a PR in eth-tester to remove the td field.

"extra_data": "extraData",
"gas_used": "gasUsed",
"base_fee_per_gas": "baseFeePerGas",
Expand Down
2 changes: 0 additions & 2 deletions web3/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class BlockData(TypedDict, total=False):
size: int
stateRoot: HexBytes
timestamp: Timestamp
totalDifficulty: int
transactions: Union[Sequence[HexBytes], Sequence[TxData]]
transactionsRoot: HexBytes
uncles: Sequence[HexBytes]
Expand Down Expand Up @@ -428,7 +427,6 @@ class Uncle(TypedDict):
size: int
stateRoot: HexBytes
timestamp: Timestamp
totalDifficulty: HexStr
transactions: Sequence[HexBytes]
transactionsRoot: HexBytes
uncles: Sequence[HexBytes]
Expand Down