Skip to content

Commit 79c67ce

Browse files
committed
Move GethMiner start/stop to geth tests
1 parent c431552 commit 79c67ce

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

tests/integration/go_ethereum/test_goethereum_http.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ def test_admin_stopRPC(web3):
9292

9393

9494
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
95-
pass
95+
def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type):
96+
web3.geth.miner.start()
97+
super().test_eth_replaceTransaction_already_mined(web3, unlocked_account_dual_type)
98+
web3.geth.miner.stop()
9699

97100

98101
class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):

tests/integration/go_ethereum/test_goethereum_ipc.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def test_admin_peers(web3):
6262

6363

6464
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
65-
pass
65+
def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type):
66+
web3.geth.miner.start()
67+
super().test_eth_replaceTransaction_already_mined(web3, unlocked_account_dual_type)
68+
web3.geth.miner.stop()
6669

6770

6871
class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):

tests/integration/go_ethereum/test_goethereum_ws.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def test_admin_stopWS(self, web3):
9797

9898

9999
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
100-
pass
100+
def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type):
101+
web3.geth.miner.start()
102+
super().test_eth_replaceTransaction_already_mined(web3, unlocked_account_dual_type)
103+
web3.geth.miner.stop()
101104

102105

103106
class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):

web3/_utils/module_testing/eth_module.py

-4
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,6 @@ def test_eth_replaceTransaction_non_existing_transaction(
466466
def test_eth_replaceTransaction_already_mined(
467467
self, web3: "Web3", unlocked_account_dual_type: ChecksumAddress
468468
) -> None:
469-
if 'v1.9.7' in web3.clientVersion:
470-
web3.geth.miner.start()
471469
txn_params: TxParams = {
472470
'from': unlocked_account_dual_type,
473471
'to': unlocked_account_dual_type,
@@ -481,8 +479,6 @@ def test_eth_replaceTransaction_already_mined(
481479
txn_params['gasPrice'] = Wei(web3.eth.gasPrice * 2)
482480
with pytest.raises(ValueError, match="Supplied transaction with hash"):
483481
web3.eth.replaceTransaction(txn_hash, txn_params)
484-
if 'v1.9.7' in web3.clientVersion:
485-
web3.geth.miner.stop()
486482

487483
def test_eth_replaceTransaction_incorrect_nonce(
488484
self, web3: "Web3", unlocked_account: ChecksumAddress

0 commit comments

Comments
 (0)