foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Customize delay in `forge script`

Open adhusson opened this issue 2 years ago • 1 comments

Component

Forge

Describe the feature you would like

forge script waits 7 seconds by default before asking for transaction receipts. It is not a good initial value for running tests since a local anvil node will be able to respond right away.

Adding --delay parameter would do the trick. I was told that by default the delay is 100ms when the node is localhost, which I think comes from these lines in anvil/src/lib.rs. But what I'm talking about seems more related to the definition of PendingTransaction and DEFAULT_POLL_INTERVAL. I don't know Rust at all though so I may be totally off.

An alternative solution would be to effectively implement the "100ms delay in forge script for localhost" rule.

Additional context

No response

adhusson avatar Aug 03 '22 01:08 adhusson

This is going to be solved by #2559 but will not include user config (the poll interval will be lowered for dev nodes though)

onbjerg avatar Aug 03 '22 10:08 onbjerg

This is now handled automatically

onbjerg avatar Aug 11 '22 18:08 onbjerg