diff --git a/docs/web3.geth.rst b/docs/web3.geth.rst index d21bf2a8e0..c42c3a87ec 100644 --- a/docs/web3.geth.rst +++ b/docs/web3.geth.rst @@ -125,12 +125,6 @@ The ``web3.geth.admin`` object exposes methods to interact with the RPC APIs und >>> web3.geth.admin.start_http() True - - -.. py:method:: start_rpc() - - .. warning:: Deprecated: This method is deprecated in favor of - :meth:`~web3.geth.admin.start_http()` .. py:method:: start_ws(host='localhost', port=8546, cors="", apis="eth,net,web3") @@ -160,12 +154,6 @@ The ``web3.geth.admin`` object exposes methods to interact with the RPC APIs und True -.. py:method:: stop_rpc() - - .. warning:: Deprecated: This method is deprecated in favor of - :meth:`~web3.geth.admin.stop_http()` - - .. py:method:: stop_ws() * Delegates to ``admin_stopWS`` RPC Method diff --git a/newsfragments/2731.removal.rst b/newsfragments/2731.removal.rst new file mode 100644 index 0000000000..f8ade18eb9 --- /dev/null +++ b/newsfragments/2731.removal.rst @@ -0,0 +1 @@ +Remove already-deprecated ``start_rpc`` and ``stop_rpc`` from the ``w3.geth.admin`` module. diff --git a/tests/integration/go_ethereum/test_goethereum_http.py b/tests/integration/go_ethereum/test_goethereum_http.py index adceec36fe..deeeeb775c 100644 --- a/tests/integration/go_ethereum/test_goethereum_http.py +++ b/tests/integration/go_ethereum/test_goethereum_http.py @@ -114,11 +114,6 @@ def test_admin_start_stop_ws(self, w3: "Web3") -> None: pytest.xfail(reason="Only one WS endpoint is allowed to be active at any time") super().test_admin_start_stop_ws(w3) - def test_admin_start_stop_rpc(self, w3: "Web3") -> None: - # This test causes all tests after it to fail on CI if it's allowed to run - pytest.xfail(reason="Only one RPC endpoint is allowed to be active at any time") - super().test_admin_start_stop_rpc(w3) - class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest): pass @@ -187,12 +182,6 @@ async def test_admin_start_stop_ws(self, w3: "Web3") -> None: pytest.xfail(reason="Only one WS endpoint is allowed to be active at any time") await super().test_admin_start_stop_ws(w3) - @pytest.mark.asyncio - async def test_admin_start_stop_rpc(self, w3: "Web3") -> None: - # This test causes all tests after it to fail on CI if it's allowed to run - pytest.xfail(reason="Only one RPC endpoint is allowed to be active at any time") - await super().test_admin_start_stop_rpc(w3) - class TestGoEthereumAsyncNetModuleTest(GoEthereumAsyncNetModuleTest): pass diff --git a/tests/integration/go_ethereum/test_goethereum_ipc.py b/tests/integration/go_ethereum/test_goethereum_ipc.py index d7979f2966..4fd7236b69 100644 --- a/tests/integration/go_ethereum/test_goethereum_ipc.py +++ b/tests/integration/go_ethereum/test_goethereum_ipc.py @@ -77,11 +77,6 @@ def test_admin_start_stop_ws(self, w3: "Web3") -> None: pytest.xfail(reason="Only one WS endpoint is allowed to be active at any time") super().test_admin_start_stop_ws(w3) - def test_admin_start_stop_rpc(self, w3: "Web3") -> None: - # This test causes all tests after it to fail on CI if it's allowed to run - pytest.xfail(reason="Only one RPC endpoint is allowed to be active at any time") - super().test_admin_start_stop_rpc(w3) - class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest): pass diff --git a/tests/integration/go_ethereum/test_goethereum_ws.py b/tests/integration/go_ethereum/test_goethereum_ws.py index f6247afb3c..c98a17515f 100644 --- a/tests/integration/go_ethereum/test_goethereum_ws.py +++ b/tests/integration/go_ethereum/test_goethereum_ws.py @@ -93,12 +93,6 @@ def test_admin_start_stop_ws(self, w3: "Web3") -> None: ) super().test_admin_start_stop_ws(w3) - def test_admin_start_stop_rpc(self, w3: "Web3") -> None: - pytest.xfail( - reason="This test inconsistently causes all tests after it on CI to fail if it's allowed to run" # noqa: E501 - ) - super().test_admin_start_stop_rpc(w3) - class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest): pass diff --git a/web3/_utils/admin.py b/web3/_utils/admin.py index a494eb95f1..c55fcf291b 100644 --- a/web3/_utils/admin.py +++ b/web3/_utils/admin.py @@ -11,7 +11,6 @@ RPC, ) from web3.method import ( - DeprecatedMethod, Method, default_root_munger, ) @@ -26,7 +25,7 @@ def admin_start_params_munger( - module: Module, + _module: Module, host: str = "localhost", port: int = 8546, cors: str = "", @@ -92,9 +91,3 @@ def __call__( RPC.admin_stopWS, is_property=True, ) - -# -# Deprecated Methods -# -start_rpc = DeprecatedMethod(start_http, "start_rpc", "start_http") -stop_rpc = DeprecatedMethod(stop_http, "stop_rpc", "stop_http") diff --git a/web3/_utils/module_testing/go_ethereum_admin_module.py b/web3/_utils/module_testing/go_ethereum_admin_module.py index 34aa93379d..17c567e500 100644 --- a/web3/_utils/module_testing/go_ethereum_admin_module.py +++ b/web3/_utils/module_testing/go_ethereum_admin_module.py @@ -57,17 +57,6 @@ def test_admin_start_stop_http(self, w3: "Web3") -> None: start = w3.geth.admin.start_http() assert start is True - def test_admin_start_stop_rpc(self, w3: "Web3") -> None: - with pytest.warns(DeprecationWarning, match="deprecated in favor of stop_http"): - stop = w3.geth.admin.stop_rpc() - assert stop is True - - with pytest.warns( - DeprecationWarning, match="deprecated in favor of start_http" - ): - start = w3.geth.admin.start_rpc() - assert start is True - def test_admin_start_stop_ws(self, w3: "Web3") -> None: stop = w3.geth.admin.stop_ws() assert stop is True @@ -107,18 +96,6 @@ async def test_admin_start_stop_http(self, w3: "Web3") -> None: start = await w3.geth.admin.start_http() # type: ignore assert start is True - @pytest.mark.asyncio - async def test_admin_start_stop_rpc(self, w3: "Web3") -> None: - with pytest.warns(DeprecationWarning, match="deprecated in favor of stop_http"): - stop = await w3.geth.admin.stop_rpc() - assert stop is True - - with pytest.warns( - DeprecationWarning, match="deprecated in favor of start_http" - ): - start = await w3.geth.admin.start_rpc() - assert start is True - @pytest.mark.asyncio async def test_admin_start_stop_ws(self, w3: "Web3") -> None: stop = await w3.geth.admin.stop_ws() # type: ignore diff --git a/web3/geth.py b/web3/geth.py index ccfa64c9a1..0e40fe45cd 100644 --- a/web3/geth.py +++ b/web3/geth.py @@ -22,15 +22,10 @@ node_info, peers, start_http, - start_rpc, start_ws, stop_http, - stop_rpc, stop_ws, ) -from web3._utils.decorators import ( - deprecated_for, -) from web3._utils.miner import ( make_dag, set_etherbase, @@ -223,9 +218,6 @@ class BaseGethAdmin(Module): _start_ws = start_ws _stop_http = stop_http _stop_ws = stop_ws - # deprecated - _start_rpc = start_rpc - _stop_rpc = stop_rpc class GethAdmin(BaseGethAdmin): @@ -262,25 +254,11 @@ def start_ws( return self._start_ws(host, port, cors, apis) def stop_http(self) -> bool: - return self._stop_rpc() + return self._stop_http() def stop_ws(self) -> bool: return self._stop_ws() - @deprecated_for("start_http") - def start_rpc( - self, - host: str = "localhost", - port: int = 8546, - cors: str = "", - apis: str = "eth,net,web3", - ) -> bool: - return self._start_rpc(host, port, cors, apis) - - @deprecated_for("stop_http") - def stop_rpc(self) -> bool: - return self._stop_rpc() - class AsyncGethAdmin(BaseGethAdmin): is_async = True @@ -321,20 +299,6 @@ async def stop_http(self) -> Awaitable[bool]: async def stop_ws(self) -> Awaitable[bool]: return await self._stop_ws() # type: ignore - @deprecated_for("start_http") - async def start_rpc( - self, - host: str = "localhost", - port: int = 8546, - cors: str = "", - apis: str = "eth,net,web3", - ) -> Awaitable[bool]: - return await self._start_rpc(host, port, cors, apis) - - @deprecated_for("stop_http") - async def stop_rpc(self) -> Awaitable[bool]: - return await self._stop_rpc() - class GethMiner(Module): """ diff --git a/web3/providers/eth_tester/defaults.py b/web3/providers/eth_tester/defaults.py index 5d21892a55..3a4d9f5598 100644 --- a/web3/providers/eth_tester/defaults.py +++ b/web3/providers/eth_tester/defaults.py @@ -354,9 +354,6 @@ def personal_send_transaction(eth_tester: "EthereumTester", params: Any) -> HexS "start_ws": not_implemented, "stop_http": not_implemented, "stop_ws": not_implemented, - # deprecated - "start_rpc": not_implemented, - "stop_rpc": not_implemented, }, "debug": { "backtraceAt": not_implemented,