Fixes #28601, see #28403 (review)
Add Context Manager to manage the locking and unlocking of locked wallets with a passphrase during testing.
Fixes #28601, see #28403 (review)
Add Context Manager to manage the locking and unlocking of locked wallets with a passphrase during testing.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | kevkevinpal, maflcko |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
121 | @@ -122,3 +122,21 @@ def generate_keypair(compressed=True, wif=False): 122 | if wif: 123 | privkey = bytes_to_wif(privkey.get_bytes(), compressed) 124 | return privkey, pubkey 125 | + 126 | +class WalletUnlockContextManager():
class WalletUnlock():
nit: I don't think other context managers have it in their name, so could remove this as well, but no strong opinion, either is fine.
done
126 | +class WalletUnlockContextManager(): 127 | + """ 128 | + A context manager for unlocking a wallet with a passphrase and automatically locking it afterward. 129 | + """ 130 | + 131 | + TIMEOUT = 999000 # WALLET_PASSPHRASE_TIMEOUT
What does the comment mean?
nit: Could use the maximum allowed value?
done
I think there is one more that can be using the context:
test/functional/wallet_fundrawtransaction.py: wallet.walletpassphrase("test", 999000)
Add Context Manager to manage wallet locking/unlocking with passphrase
@maflcko could you please review the changes
lgtm ACK 004903e
lgtm ACK 004903ebade38ba47c5ddc17b756d605b963528e
Hey @BrandonOdiwuor, nice work on these changes. I know that this PR has been closed, but I finally finished my review of all the files. Apologies for the delay. I'm trying to get up to speed and have to work very slowly at the moment. I learned a ton from your work and have already gotten some value from the code review, but I'm not sure of the best way to contribute these changes. They can be found here:
https://github.com/bitcoin/bitcoin/compare/master...kashifs:bitcoin:master
Please let me know what you think. Thanks!