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

fix: eth-tester was failing with too-low base fee errors #2489

Merged
merged 4 commits into from
Jan 31, 2025
Merged
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 src/ape_test/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def add_account(self, private_key: str):
self.evm_backend.add_account(private_key)

def _get_last_base_fee(self) -> int:
base_fee = self._get_latest_block_rpc().get("base_fee_per_gas", None)
base_fee = self.evm_backend.get_block_by_number("pending").get("base_fee_per_gas", None)
if base_fee is not None:
return base_fee

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_transfer_without_value_send_everything_true_with_low_gas(sender, receiv

# Clear balance of sender.
# Use small gas so for sure runs out of money.
receipt = sender.transfer(receiver, send_everything=True, gas=21000)
receipt = sender.transfer(receiver, send_everything=True, gas=22000)

value_given = receipt.value
total_spent = value_given + receipt.total_fees_paid
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def rate_limit_hook(self, rpc, params):

def test_base_fee(eth_tester_provider):
actual = eth_tester_provider.base_fee
assert actual > 0
assert actual >= eth_tester_provider.get_block("pending").base_fee

# NOTE: Mostly doing this to ensure we are calling the fee history
# RPC correctly. There was a bug where we were not.
Expand Down
Loading