Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Oct 26, 2024
1 parent ccf51d1 commit 4d18122
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/functional/geth/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,12 +707,21 @@ def test_estimate_gas_cost_of_static_fee_txn(geth_contract, geth_provider, geth_


@geth_process_test
def test_estimate_gas_cost_reverts(geth_contract, geth_provider, geth_second_account):
def test_estimate_gas_cost_reverts_with_message(geth_contract, geth_provider, geth_second_account):
# NOTE: The error message from not-owner is "!authorized".
txn = geth_contract.setNumber.as_transaction(900, sender=geth_second_account, type=0)
with pytest.raises(ContractLogicError):
geth_provider.estimate_gas_cost(txn)


@geth_process_test
def test_estimate_gas_cost_reverts_no_message(geth_contract, geth_provider, geth_account):
# NOTE: The error message from using `5` has no revert message.
txn = geth_contract.setNumber.as_transaction(5, sender=geth_account, type=0)
with pytest.raises(ContractLogicError):
geth_provider.estimate_gas_cost(txn)


@geth_process_test
@pytest.mark.parametrize("tx_type", TransactionType)
def test_prepare_transaction_with_max_gas(tx_type, geth_provider, ethereum, geth_account):
Expand Down

0 comments on commit 4d18122

Please sign in to comment.