wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.19k stars 292 forks source link

Make network deployment file copying to localhost synchronous #398

Closed bstchow closed 1 year ago

bstchow commented 1 year ago

Reason for change

Completion of the TASK_NODE_GET_PROVIDER task should produce consistent results. Subsequent operations should be able to depend upon the contents of the deployments/localhost folder.

fs.copy is an asynchronous operation and it can be awaited to guarantee completion

Context

In our project, we were running hardhat-deploy's TASK_NODE_GET_PROVIDER task and the hardhat node task in serial. We saw system-dependent errors where Hardhat's JSON-RPC server would fail to start because the .chainId file was not always copied into deployments/localhost when hardhat node began running. This would only occur on some machines, and not others.

wighawag commented 1 year ago

Thanks @bstchow

available in v0.11.41