From 7442604ce7be4f66f33c413aea64d6a3f6c4f954 Mon Sep 17 00:00:00 2001 From: The Dance Date: Wed, 29 Jan 2025 23:04:02 +0000 Subject: [PATCH] fix: fix block-time flag to work on anvil --- docs/userguides/networks.md | 2 +- src/ape_networks/_cli.py | 18 ++---------------- tests/integration/cli/test_networks.py | 6 +----- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/docs/userguides/networks.md b/docs/userguides/networks.md index ae44a21fd3..29b37be351 100644 --- a/docs/userguides/networks.md +++ b/docs/userguides/networks.md @@ -499,7 +499,7 @@ To use a different network, such as `hardhat` or Anvil nodes, use the `--network ape networks run --network ethereum:local:foundry ``` -To configure the network process, use `--block_time`, `--base-fee-multiplier`, and `--transaction-timeout` flags. +To configure the network process, use `--block_time` flag. ## Provider Interaction diff --git a/src/ape_networks/_cli.py b/src/ape_networks/_cli.py index 4ca500ef38..7621d4f867 100644 --- a/src/ape_networks/_cli.py +++ b/src/ape_networks/_cli.py @@ -113,14 +113,7 @@ def make_sub_tree(data: dict, create_tree: Callable) -> Tree: @ape_cli_context() @network_option(default="ethereum:local:node") @click.option("--block-time", default=None, type=int, help="Block time in seconds") -@click.option("--base-fee-multiplier", default=None, type=float, help="Base fee multiplier") -@click.option( - "--transaction-timeout", - default=None, - type=int, - help="Transaction acceptance timeout in seconds", -) -def run(cli_ctx, provider, block_time, base_fee_multiplier, transaction_timeout): +def run(cli_ctx, provider, block_time): """ Start a subprocess node as if running independently and stream stdout and stderr. @@ -139,14 +132,7 @@ def run(cli_ctx, provider, block_time, base_fee_multiplier, transaction_timeout) # Set block time if provided if block_time is not None: provider.network.block_time = block_time - - # Set transaction acceptance timeout if provided - if transaction_timeout is not None: - provider.network.transaction_acceptance_timeout = transaction_timeout - - # Set base fee multiplier if provided - if base_fee_multiplier is not None: - provider.network.base_fee_multiplier = base_fee_multiplier + provider.provider_settings.update({"block_time": block_time}) # Start showing process logs. original_level = cli_ctx.logger.level diff --git a/tests/integration/cli/test_networks.py b/tests/integration/cli/test_networks.py index e8e70ea1a2..45d33bc58f 100644 --- a/tests/integration/cli/test_networks.py +++ b/tests/integration/cli/test_networks.py @@ -202,7 +202,7 @@ def test_run_custom_network(ape_cli, runner): @run_once -def test_run_custom_args(ape_cli, runner): +def test_run_block_time(ape_cli, runner): cmd = ( "networks", "run", @@ -210,10 +210,6 @@ def test_run_custom_args(ape_cli, runner): "ethereum:local:test", "--block-time", "10", - "--base-fee-multiplier", - "1.2", - "--transaction-timeout", - "60", ) result = runner.invoke(ape_cli, cmd) expected = "`ape networks run` requires a provider that manages a process, not 'test'"