diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 5f7c68daaa..22cb199229 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -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': []} diff --git a/docs/web3.eth.rst b/docs/web3.eth.rst index bdea4e20ea..465a6440f1 100644 --- a/docs/web3.eth.rst +++ b/docs/web3.eth.rst @@ -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': [], @@ -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': [] diff --git a/newsfragments/3502.removal.rst b/newsfragments/3502.removal.rst new file mode 100644 index 0000000000..0e34e2bddc --- /dev/null +++ b/newsfragments/3502.removal.rst @@ -0,0 +1 @@ +remove ``totalDifficulty`` field diff --git a/tests/core/eth-module/test_block_api.py b/tests/core/eth-module/test_block_api.py index e295953181..25790d68ef 100644 --- a/tests/core/eth-module/test_block_api.py +++ b/tests/core/eth-module/test_block_api.py @@ -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, @@ -79,7 +78,6 @@ def test_get_block_formatters_with_pre_formatted_values(w3, request_mocker): "stateRoot": ( "0xfeed54faf6bb151112970b460118ed790197d69df7fcdd79801d120851723c88" ), - "totalDifficulty": "0x9bf9a3", "transactionsRoot": ( "0xafeedbeef5f30efc9baf28e49271302e9b569cfa1e8e9d9512360eb8e7c667a7" ), @@ -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]), diff --git a/web3/_utils/method_formatters.py b/web3/_utils/method_formatters.py index 5fef242614..898ef097d3 100644 --- a/web3/_utils/method_formatters.py +++ b/web3/_utils/method_formatters.py @@ -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( ( ( diff --git a/web3/providers/eth_tester/middleware.py b/web3/providers/eth_tester/middleware.py index 72ab204076..426648c077 100644 --- a/web3/providers/eth_tester/middleware.py +++ b/web3/providers/eth_tester/middleware.py @@ -182,7 +182,6 @@ def is_hexstr(value: Any) -> bool: "logs_bloom": "logsBloom", "state_root": "stateRoot", "receipts_root": "receiptsRoot", - "total_difficulty": "totalDifficulty", "extra_data": "extraData", "gas_used": "gasUsed", "base_fee_per_gas": "baseFeePerGas", diff --git a/web3/types.py b/web3/types.py index 7b2a227e23..8a2fa141b5 100644 --- a/web3/types.py +++ b/web3/types.py @@ -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] @@ -428,7 +427,6 @@ class Uncle(TypedDict): size: int stateRoot: HexBytes timestamp: Timestamp - totalDifficulty: HexStr transactions: Sequence[HexBytes] transactionsRoot: HexBytes uncles: Sequence[HexBytes]