Skip to content

Commit 7442604

Browse files
committed
fix: fix block-time flag to work on anvil
1 parent cb1ec06 commit 7442604

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

docs/userguides/networks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ To use a different network, such as `hardhat` or Anvil nodes, use the `--network
499499
ape networks run --network ethereum:local:foundry
500500
```
501501

502-
To configure the network process, use `--block_time`, `--base-fee-multiplier`, and `--transaction-timeout` flags.
502+
To configure the network process, use `--block_time` flag.
503503

504504
## Provider Interaction
505505

src/ape_networks/_cli.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,7 @@ def make_sub_tree(data: dict, create_tree: Callable) -> Tree:
113113
@ape_cli_context()
114114
@network_option(default="ethereum:local:node")
115115
@click.option("--block-time", default=None, type=int, help="Block time in seconds")
116-
@click.option("--base-fee-multiplier", default=None, type=float, help="Base fee multiplier")
117-
@click.option(
118-
"--transaction-timeout",
119-
default=None,
120-
type=int,
121-
help="Transaction acceptance timeout in seconds",
122-
)
123-
def run(cli_ctx, provider, block_time, base_fee_multiplier, transaction_timeout):
116+
def run(cli_ctx, provider, block_time):
124117
"""
125118
Start a subprocess node as if running independently
126119
and stream stdout and stderr.
@@ -139,14 +132,7 @@ def run(cli_ctx, provider, block_time, base_fee_multiplier, transaction_timeout)
139132
# Set block time if provided
140133
if block_time is not None:
141134
provider.network.block_time = block_time
142-
143-
# Set transaction acceptance timeout if provided
144-
if transaction_timeout is not None:
145-
provider.network.transaction_acceptance_timeout = transaction_timeout
146-
147-
# Set base fee multiplier if provided
148-
if base_fee_multiplier is not None:
149-
provider.network.base_fee_multiplier = base_fee_multiplier
135+
provider.provider_settings.update({"block_time": block_time})
150136

151137
# Start showing process logs.
152138
original_level = cli_ctx.logger.level

tests/integration/cli/test_networks.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,14 @@ def test_run_custom_network(ape_cli, runner):
202202

203203

204204
@run_once
205-
def test_run_custom_args(ape_cli, runner):
205+
def test_run_block_time(ape_cli, runner):
206206
cmd = (
207207
"networks",
208208
"run",
209209
"--network",
210210
"ethereum:local:test",
211211
"--block-time",
212212
"10",
213-
"--base-fee-multiplier",
214-
"1.2",
215-
"--transaction-timeout",
216-
"60",
217213
)
218214
result = runner.invoke(ape_cli, cmd)
219215
expected = "`ape networks run` requires a provider that manages a process, not 'test'"

0 commit comments

Comments
 (0)