Skip to content

Commit

Permalink
Move GethMiner start/stop to geth tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Jan 15, 2020
1 parent c431552 commit 79c67ce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion tests/integration/go_ethereum/test_goethereum_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def test_admin_stopRPC(web3):


class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
pass
def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type):
web3.geth.miner.start()
super().test_eth_replaceTransaction_already_mined(web3, unlocked_account_dual_type)
web3.geth.miner.stop()


class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/go_ethereum/test_goethereum_ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def test_admin_peers(web3):


class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
pass
def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type):
web3.geth.miner.start()
super().test_eth_replaceTransaction_already_mined(web3, unlocked_account_dual_type)
web3.geth.miner.stop()


class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/go_ethereum/test_goethereum_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def test_admin_stopWS(self, web3):


class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
pass
def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type):
web3.geth.miner.start()
super().test_eth_replaceTransaction_already_mined(web3, unlocked_account_dual_type)
web3.geth.miner.stop()


class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):
Expand Down
4 changes: 0 additions & 4 deletions web3/_utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ def test_eth_replaceTransaction_non_existing_transaction(
def test_eth_replaceTransaction_already_mined(
self, web3: "Web3", unlocked_account_dual_type: ChecksumAddress
) -> None:
if 'v1.9.7' in web3.clientVersion:
web3.geth.miner.start()
txn_params: TxParams = {
'from': unlocked_account_dual_type,
'to': unlocked_account_dual_type,
Expand All @@ -481,8 +479,6 @@ def test_eth_replaceTransaction_already_mined(
txn_params['gasPrice'] = Wei(web3.eth.gasPrice * 2)
with pytest.raises(ValueError, match="Supplied transaction with hash"):
web3.eth.replaceTransaction(txn_hash, txn_params)
if 'v1.9.7' in web3.clientVersion:
web3.geth.miner.stop()

def test_eth_replaceTransaction_incorrect_nonce(
self, web3: "Web3", unlocked_account: ChecksumAddress
Expand Down

0 comments on commit 79c67ce

Please sign in to comment.