Skip to content

Commit 9073707

Browse files
authored
fix: eth-tester was failing with too-low base fee errors (#2489)
Co-authored-by: antazoey <antyzoa@gmail.com>
1 parent 8bf2e2d commit 9073707

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ape_test/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def add_account(self, private_key: str):
498498
self.evm_backend.add_account(private_key)
499499

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

tests/functional/test_accounts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_transfer_without_value_send_everything_true_with_low_gas(sender, receiv
170170

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

175175
value_given = receipt.value
176176
total_spent = value_given + receipt.total_fees_paid

tests/functional/test_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def rate_limit_hook(self, rpc, params):
534534

535535
def test_base_fee(eth_tester_provider):
536536
actual = eth_tester_provider.base_fee
537-
assert actual > 0
537+
assert actual >= eth_tester_provider.get_block("pending").base_fee
538538

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

0 commit comments

Comments
 (0)