Skip to content

Commit

Permalink
Remove tests for SolidityError
Browse files Browse the repository at this point in the history
  • Loading branch information
kclowes committed Jan 8, 2021
1 parent 6ab6e7e commit 0757c86
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/core/contracts/test_contract_call_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import eth_abi
from eth_tester.exceptions import (
SolidityError,
RevertTransaction,
)
from eth_utils import (
is_text,
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions tests/core/utilities/test_method_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
RPC,
)
from web3.exceptions import (
SolidityError,
RevertTransaction,
)
from web3.types import (
RPCResponse,
Expand Down Expand Up @@ -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)


Expand All @@ -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
10 changes: 5 additions & 5 deletions web3/_utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
BlockNotFound,
InvalidAddress,
NameNotFound,
SolidityError,
RevertTransaction,
TransactionNotFound,
)
from web3.types import ( # noqa: F401
Expand Down Expand Up @@ -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",
Expand All @@ -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={
Expand All @@ -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",
Expand All @@ -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={
Expand Down

0 comments on commit 0757c86

Please sign in to comment.