Skip to content

Commit

Permalink
fix: eth-tester was failing with too-low base fee errors (#2489)
Browse files Browse the repository at this point in the history
Co-authored-by: antazoey <[email protected]>
  • Loading branch information
antazoey and antazoey authored Jan 31, 2025
1 parent 8bf2e2d commit 9073707
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit 9073707

Please sign in to comment.