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

feat: allow configuring disable_block_gas_limit #84

Merged
merged 7 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions ape_foundry/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ def build_command(self) -> List[str]:
f"{self.settings.base_fee}",
"--gas-price",
f"{self.settings.gas_price}",
"--disable-block-gas-limit",
]

if not self.settings.auto_mine:
Expand Down
10 changes: 8 additions & 2 deletions tests/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def test_snapshot_and_revert(connected_provider):
assert block_1.hash == block_3.hash


def test_unlock_account(connected_provider, contract_a, accounts):
@pytest.mark.parametrize("tx_type", (None, 0, 1, 2))
def test_unlock_account(connected_provider, contract_a, accounts, tx_type):
actual = connected_provider.unlock_account(TEST_WALLET_ADDRESS)
assert actual is True

Expand All @@ -108,7 +109,12 @@ def test_unlock_account(connected_provider, contract_a, accounts):

# Ensure can transact.
# NOTE: Using type 0 to avoid needing to set a balance.
receipt_0 = contract_a.methodWithoutArguments(sender=acct, type=0)
acct.balance += 1_000_000_000_000_000_000

# Also testing the case where `type` is omitted completely.
tx_kwargs = {"type": tx_type} if tx_type is not None else {}

receipt_0 = contract_a.methodWithoutArguments(sender=acct, **tx_kwargs)
assert not receipt_0.failed


Expand Down
Loading