wighawag / hardhat-deploy

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

Make sure to close an existing connection before every transaction since it's currently not being handled properly by ethers #303

Closed lbeder closed 1 year ago

lbeder commented 2 years ago

I have also encountered https://github.com/wighawag/hardhat-deploy/issues/88 where ethers doesn't close (or reuses) open HID connections correctly, which makes it impossible to execute the scripts using a Ledger device, resulting in a crash in node-hid.

This PR fixes this issue by keeping track of an opened LedgerSigner instance and closing it before ethers attempts to open another connection to the device.

I tested this on our heavy deployment (https://github.com/bancorprotocol/contracts-v3/tree/dev/deploy), and everything works properly.

lbeder commented 2 years ago

Hey @wighawag, could you take a look? We have been using this for over a month very successfully with many transactions in a single script

yudilevi commented 2 years ago

Hey @wighawag, any update on this one?

lbeder commented 1 year ago

@wighawag?

sshmaxime commented 1 year ago

Hey @wighawag, this is the very last missing piece for hardhat-deploy to fully work with Ledger (or at least a Ledger Nano X). I haven't looked at the conflict of this branch but my guess is that it should be easy to merge. 🙏

wighawag commented 1 year ago

Hey @lbeder would you mind reviewing the changes and fixing the conflict.

sorry all for not being very quick on all these PR/issues, been carried away with many other things

lbeder commented 1 year ago

Hey @wighawag, done and done. Please check it out 🙏

wighawag commented 1 year ago

Excelent, thanls @lbeder

published under 0.11.28