Builds on top of #24343.
Adds additional tests, and makes ToPrivateString() always succeed, using pubkeys in case privkeys are unavailable.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | achow101 |
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.
352 | @@ -312,6 +353,9 @@ void DoCheck(const std::string& prv, const std::string& pub, const std::string& 353 | 354 | /* Infer a descriptor from the generated script, and verify its solvability and that it roundtrips. */ 355 | auto inferred = InferDescriptor(spks[n], script_provider); 356 | + if (ref.size() == 1) {
In dcc11864a8f7141298d71e5a61e686ccf0032b17 "Test roundtripping of descriptors ignoring keys"
How come this is only checked for non-ranged descriptors?
It's only checked for non-combo descriptors (because for combo is obviously doesn't hold...).
Oh, I see. ref is an array that may have multiple scripts because of combo. The line that creates it had RANGE in it and that confused me.
idk, I think it makes more sense to have two separate methods rather than different security-sensitivity based on an argument.
@luke-jr I don't think that's exactly it. If you provide a SigningProvider which happens to not contain the necessary private keys, it'll also use public ones. So I think it's better to think of it as there just being one function, which always takes a signing provider, and using its private keys. And then for convenience the ability to omit providing such a provider for the case where you just want an empty one.
Rebased.
ACK 5f2af0c1ac5ee7de3e137afaee84bd31e93abe80
102 | @@ -103,7 +103,7 @@ def run_test(self): 103 | 'desc': descsum_create('wpkh(' + xpub_acc + ')'), 104 | 'timestamp': 1296688602, 105 | }]) 106 | - assert_raises_rpc_error(-4, 'Can\'t get descriptor string', watch_only_wallet.listdescriptors, True) 107 | + assert_equal(watch_only_wallet.listdescriptors(True), watch_only_wallet.listdescriptors(False))
Is this desired behaviour? Should we check that wallet doesn't have disable_private_keys enabled and return "wallet doesn't contain private keys" error?
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
<sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>
Are you still working on this?
<!--13523179cfe9479db18ec6c5d236f789-->
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
<!--13523179cfe9479db18ec6c5d236f789-->
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
<!--13523179cfe9479db18ec6c5d236f789-->
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
Leaving this as up for grabs. I still think it's a good idea, but don't have time to pursue it now.