diff --git a/tests/core/contracts/test_contract_call_interface.py b/tests/core/contracts/test_contract_call_interface.py index ff0297d4fb..e21ce4da8c 100644 --- a/tests/core/contracts/test_contract_call_interface.py +++ b/tests/core/contracts/test_contract_call_interface.py @@ -10,7 +10,7 @@ import eth_abi from eth_tester.exceptions import ( - SolidityError, + RevertTransaction, ) from eth_utils import ( is_text, @@ -874,7 +874,7 @@ def test_call_nested_tuple_contract(nested_tuple_contract, method_input, expecte def test_call_revert_contract(revert_contract): - with pytest.raises(SolidityError, match="Function has been reverted."): + with pytest.raises(RevertTransaction, match="Function has been reverted."): # eth-tester will do a gas estimation if we don't submit a gas value, # which does not contain the revert reason. Avoid that by giving a gas # value. diff --git a/tests/core/utilities/test_method_formatters.py b/tests/core/utilities/test_method_formatters.py index ae75f09ae7..88d37de12f 100644 --- a/tests/core/utilities/test_method_formatters.py +++ b/tests/core/utilities/test_method_formatters.py @@ -8,7 +8,7 @@ RPC, ) from web3.exceptions import ( - SolidityError, + RevertTransaction, ) from web3.types import ( RPCResponse, @@ -94,7 +94,7 @@ 'test_get-ganache-revert-reason', ]) def test_get_revert_reason(response, expected) -> None: - with pytest.raises(SolidityError, match=expected): + with pytest.raises(RevertTransaction, match=expected): raise_solidity_error_on_revert(response) @@ -104,8 +104,8 @@ def test_get_revert_reason_other_error() -> None: def test_get_error_formatters() -> None: formatters = get_error_formatters(RPC.eth_call) - with pytest.raises(SolidityError, match='not allowed to monitor'): + with pytest.raises(RevertTransaction, match='not allowed to monitor'): formatters(REVERT_WITH_MSG) - with pytest.raises(SolidityError): + with pytest.raises(RevertTransaction): formatters(REVERT_WITHOUT_MSG) assert formatters(OTHER_ERROR) == OTHER_ERROR diff --git a/web3/_utils/module_testing/eth_module.py b/web3/_utils/module_testing/eth_module.py index c421ce4a87..90615af864 100644 --- a/web3/_utils/module_testing/eth_module.py +++ b/web3/_utils/module_testing/eth_module.py @@ -37,7 +37,7 @@ BlockNotFound, InvalidAddress, NameNotFound, - SolidityError, + RevertTransaction, TransactionNotFound, ) from web3.types import ( # noqa: F401 @@ -760,7 +760,7 @@ def test_eth_call_revert_with_msg( revert_contract: "Contract", unlocked_account: ChecksumAddress, ) -> None: - with pytest.raises(SolidityError, + with pytest.raises(RevertTransaction, match='execution reverted: Function has been reverted'): txn_params = revert_contract._prepare_transaction( fn_name="revertWithMessage", @@ -777,7 +777,7 @@ def test_eth_call_revert_without_msg( revert_contract: "Contract", unlocked_account: ChecksumAddress, ) -> None: - with pytest.raises(SolidityError, match="execution reverted"): + with pytest.raises(RevertTransaction, match="execution reverted"): txn_params = revert_contract._prepare_transaction( fn_name="revertWithoutMessage", transaction={ @@ -793,7 +793,7 @@ def test_eth_estimateGas_revert_with_msg( revert_contract: "Contract", unlocked_account: ChecksumAddress, ) -> None: - with pytest.raises(SolidityError, + with pytest.raises(RevertTransaction, match='execution reverted: Function has been reverted'): txn_params = revert_contract._prepare_transaction( fn_name="revertWithMessage", @@ -810,7 +810,7 @@ def test_eth_estimateGas_revert_without_msg( revert_contract: "Contract", unlocked_account: ChecksumAddress, ) -> None: - with pytest.raises(SolidityError, match="execution reverted"): + with pytest.raises(RevertTransaction, match="execution reverted"): txn_params = revert_contract._prepare_transaction( fn_name="revertWithoutMessage", transaction={