Skip to content

Commit 56c8899

Browse files
committed
Remove deprecated start_rpc and stop_rpc from web3.geth.admin module
1 parent 2f8b1cb commit 56c8899

File tree

9 files changed

+3
-105
lines changed

9 files changed

+3
-105
lines changed

docs/web3.geth.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ The ``web3.geth.admin`` object exposes methods to interact with the RPC APIs und
125125
126126
>>> web3.geth.admin.start_http()
127127
True
128-
129-
130-
.. py:method:: start_rpc()
131-
132-
.. warning:: Deprecated: This method is deprecated in favor of
133-
:meth:`~web3.geth.admin.start_http()`
134128
135129
136130
.. 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
160154
True
161155
162156
163-
.. py:method:: stop_rpc()
164-
165-
.. warning:: Deprecated: This method is deprecated in favor of
166-
:meth:`~web3.geth.admin.stop_http()`
167-
168-
169157
.. py:method:: stop_ws()
170158
171159
* Delegates to ``admin_stopWS`` RPC Method

newsfragments/2731.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove already-deprecated ``start_rpc`` and ``stop_rpc`` from the ``w3.geth.admin`` module.

tests/integration/go_ethereum/test_goethereum_http.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ def test_admin_start_stop_ws(self, w3: "Web3") -> None:
114114
pytest.xfail(reason="Only one WS endpoint is allowed to be active at any time")
115115
super().test_admin_start_stop_ws(w3)
116116

117-
def test_admin_start_stop_rpc(self, w3: "Web3") -> None:
118-
# This test causes all tests after it to fail on CI if it's allowed to run
119-
pytest.xfail(reason="Only one RPC endpoint is allowed to be active at any time")
120-
super().test_admin_start_stop_rpc(w3)
121-
122117

123118
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
124119
pass
@@ -187,12 +182,6 @@ async def test_admin_start_stop_ws(self, w3: "Web3") -> None:
187182
pytest.xfail(reason="Only one WS endpoint is allowed to be active at any time")
188183
await super().test_admin_start_stop_ws(w3)
189184

190-
@pytest.mark.asyncio
191-
async def test_admin_start_stop_rpc(self, w3: "Web3") -> None:
192-
# This test causes all tests after it to fail on CI if it's allowed to run
193-
pytest.xfail(reason="Only one RPC endpoint is allowed to be active at any time")
194-
await super().test_admin_start_stop_rpc(w3)
195-
196185

197186
class TestGoEthereumAsyncNetModuleTest(GoEthereumAsyncNetModuleTest):
198187
pass

tests/integration/go_ethereum/test_goethereum_ipc.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ def test_admin_start_stop_ws(self, w3: "Web3") -> None:
7777
pytest.xfail(reason="Only one WS endpoint is allowed to be active at any time")
7878
super().test_admin_start_stop_ws(w3)
7979

80-
def test_admin_start_stop_rpc(self, w3: "Web3") -> None:
81-
# This test causes all tests after it to fail on CI if it's allowed to run
82-
pytest.xfail(reason="Only one RPC endpoint is allowed to be active at any time")
83-
super().test_admin_start_stop_rpc(w3)
84-
8580

8681
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
8782
pass

tests/integration/go_ethereum/test_goethereum_ws.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ def test_admin_start_stop_ws(self, w3: "Web3") -> None:
9393
)
9494
super().test_admin_start_stop_ws(w3)
9595

96-
def test_admin_start_stop_rpc(self, w3: "Web3") -> None:
97-
pytest.xfail(
98-
reason="This test inconsistently causes all tests after it on CI to fail if it's allowed to run" # noqa: E501
99-
)
100-
super().test_admin_start_stop_rpc(w3)
101-
10296

10397
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
10498
pass

web3/_utils/admin.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
RPC,
1212
)
1313
from web3.method import (
14-
DeprecatedMethod,
1514
Method,
1615
default_root_munger,
1716
)
@@ -26,7 +25,7 @@
2625

2726

2827
def admin_start_params_munger(
29-
module: Module,
28+
_module: Module,
3029
host: str = "localhost",
3130
port: int = 8546,
3231
cors: str = "",
@@ -92,9 +91,3 @@ def __call__(
9291
RPC.admin_stopWS,
9392
is_property=True,
9493
)
95-
96-
#
97-
# Deprecated Methods
98-
#
99-
start_rpc = DeprecatedMethod(start_http, "start_rpc", "start_http")
100-
stop_rpc = DeprecatedMethod(stop_http, "stop_rpc", "stop_http")

web3/_utils/module_testing/go_ethereum_admin_module.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ def test_admin_start_stop_http(self, w3: "Web3") -> None:
5757
start = w3.geth.admin.start_http()
5858
assert start is True
5959

60-
def test_admin_start_stop_rpc(self, w3: "Web3") -> None:
61-
with pytest.warns(DeprecationWarning, match="deprecated in favor of stop_http"):
62-
stop = w3.geth.admin.stop_rpc()
63-
assert stop is True
64-
65-
with pytest.warns(
66-
DeprecationWarning, match="deprecated in favor of start_http"
67-
):
68-
start = w3.geth.admin.start_rpc()
69-
assert start is True
70-
7160
def test_admin_start_stop_ws(self, w3: "Web3") -> None:
7261
stop = w3.geth.admin.stop_ws()
7362
assert stop is True
@@ -107,18 +96,6 @@ async def test_admin_start_stop_http(self, w3: "Web3") -> None:
10796
start = await w3.geth.admin.start_http() # type: ignore
10897
assert start is True
10998

110-
@pytest.mark.asyncio
111-
async def test_admin_start_stop_rpc(self, w3: "Web3") -> None:
112-
with pytest.warns(DeprecationWarning, match="deprecated in favor of stop_http"):
113-
stop = await w3.geth.admin.stop_rpc()
114-
assert stop is True
115-
116-
with pytest.warns(
117-
DeprecationWarning, match="deprecated in favor of start_http"
118-
):
119-
start = await w3.geth.admin.start_rpc()
120-
assert start is True
121-
12299
@pytest.mark.asyncio
123100
async def test_admin_start_stop_ws(self, w3: "Web3") -> None:
124101
stop = await w3.geth.admin.stop_ws() # type: ignore

web3/geth.py

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,10 @@
2222
node_info,
2323
peers,
2424
start_http,
25-
start_rpc,
2625
start_ws,
2726
stop_http,
28-
stop_rpc,
2927
stop_ws,
3028
)
31-
from web3._utils.decorators import (
32-
deprecated_for,
33-
)
3429
from web3._utils.miner import (
3530
make_dag,
3631
set_etherbase,
@@ -223,9 +218,6 @@ class BaseGethAdmin(Module):
223218
_start_ws = start_ws
224219
_stop_http = stop_http
225220
_stop_ws = stop_ws
226-
# deprecated
227-
_start_rpc = start_rpc
228-
_stop_rpc = stop_rpc
229221

230222

231223
class GethAdmin(BaseGethAdmin):
@@ -262,25 +254,11 @@ def start_ws(
262254
return self._start_ws(host, port, cors, apis)
263255

264256
def stop_http(self) -> bool:
265-
return self._stop_rpc()
257+
return self._stop_http()
266258

267259
def stop_ws(self) -> bool:
268260
return self._stop_ws()
269261

270-
@deprecated_for("start_http")
271-
def start_rpc(
272-
self,
273-
host: str = "localhost",
274-
port: int = 8546,
275-
cors: str = "",
276-
apis: str = "eth,net,web3",
277-
) -> bool:
278-
return self._start_rpc(host, port, cors, apis)
279-
280-
@deprecated_for("stop_http")
281-
def stop_rpc(self) -> bool:
282-
return self._stop_rpc()
283-
284262

285263
class AsyncGethAdmin(BaseGethAdmin):
286264
is_async = True
@@ -321,20 +299,6 @@ async def stop_http(self) -> Awaitable[bool]:
321299
async def stop_ws(self) -> Awaitable[bool]:
322300
return await self._stop_ws() # type: ignore
323301

324-
@deprecated_for("start_http")
325-
async def start_rpc(
326-
self,
327-
host: str = "localhost",
328-
port: int = 8546,
329-
cors: str = "",
330-
apis: str = "eth,net,web3",
331-
) -> Awaitable[bool]:
332-
return await self._start_rpc(host, port, cors, apis)
333-
334-
@deprecated_for("stop_http")
335-
async def stop_rpc(self) -> Awaitable[bool]:
336-
return await self._stop_rpc()
337-
338302

339303
class GethMiner(Module):
340304
"""

web3/providers/eth_tester/defaults.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,6 @@ def personal_send_transaction(eth_tester: "EthereumTester", params: Any) -> HexS
354354
"start_ws": not_implemented,
355355
"stop_http": not_implemented,
356356
"stop_ws": not_implemented,
357-
# deprecated
358-
"start_rpc": not_implemented,
359-
"stop_rpc": not_implemented,
360357
},
361358
"debug": {
362359
"backtraceAt": not_implemented,

0 commit comments

Comments
 (0)