Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop masking Revert error as TransactionFailed #180

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eth_tester/backends/pyevm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def _max_available_gas(self):

@replace_exceptions({
EVMInvalidInstruction: TransactionFailed,
EVMRevert: TransactionFailed})
})
def estimate_gas(self, transaction):
evm_transaction = self._get_normalized_and_unsigned_evm_transaction(assoc(
transaction, 'gas', 21000))
Expand Down
7 changes: 6 additions & 1 deletion eth_tester/utils/backend_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
_make_call_throws_transaction,
_decode_throws_result,
)
from eth_tester.backends.pyevm.utils import is_pyevm_available
if is_pyevm_available():
from eth.exceptions import (
Revert as EVMRevert,
)


PK_A = '0x58d23b55bc9cdce1f18c2500f40ff4ab7245df9a89505e9b1fa4851f623d241d'
Expand Down Expand Up @@ -719,7 +724,7 @@ def test_can_estimate_gas_after_exception_raised_estimating_gas(self, eth_tester
'throw_contract',
'willThrow',
)
with pytest.raises(TransactionFailed):
with pytest.raises(EVMRevert):
eth_tester.estimate_gas(dissoc(call_will_throw_transaction, 'gas'))

call_set_value_transaction = _make_call_throws_transaction(
Expand Down