foundry
foundry copied to clipboard
Customize delay in `forge script`
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
This is going to be solved by #2559 but will not include user config (the poll interval will be lowered for dev nodes though)
This is now handled automatically