-
Notifications
You must be signed in to change notification settings - Fork 40
fix: differentiate legacy and segwit types for p2sh when using Descriptor::scriptpubkey_type
#94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: differentiate legacy and segwit types for p2sh when using Descriptor::scriptpubkey_type
#94
Conversation
7c36b98 to
b10ec83
Compare
Descriptor::scriptpubkey_type
b10ec83 to
8b3b079
Compare
|
The commit from this pull request has now been merged into Embit's develop branch. |
|
Note: To include this in release-notes since this alters api/expected-return where existing projects may be expecting "p2sh" |
|
Another issue: Edit: I believe |
|
How Specter DIY and SS does that if it is not implemented? |
I think that something like this could be used in - if psbt_scope.script_pubkey.script_type() != self.scriptpubkey_type():
+ if psbt_scope.script_pubkey.script_type() not in self.scriptpubkey_type():
yup, but during the sign procedure we can check, as a lib, if there's
|
It seems to be a good idea!
With the above idea it might not be necessary. |
dc53d59 to
99e8046
Compare
Changed. Also some test cases for singlesig and nested contexts (need to think in more cases and add some taproot cases). |
48c6ecb to
979ce96
Compare
c0c2469 to
ef2dbcd
Compare
Also started with some signet PSBTs for testing |
a14f884 to
b85d92f
Compare
Add a check for `p2sh-p2wsh`, `p2sh-p2wpkh` as well reorginize existing scriptypes for `scriptpubkey_type`. Also add a bool type cast for situations where some non-bool values could be returned in `is_wrapped` and `is_segwit` property methods. fix diybitcoinhardware#93 Co-authored-by: edilmedeiros <jose.edil@gmail.com> Co-authored-by: moisespompilio <93723302+moisesPompilio@users.noreply.github.com>
Add some singlesig test cases (common in descriptors like sparrow, electrum, nunchuck...) calling for `Descriptor.scriptpubkey_type` and add this last method in the multisig test cases, comparing if they return, correctly, the p2sh, p2pkh, p2sh-p2wpkh, p2sh-p2wsh, p2wsh and p2tr types. Also add tests for `Descriptor.owns` method for p2sh, p2sh-p2wpkh, p2sh-p2wsh and p2wsh unsigned and signed PSBTs.
b85d92f to
8115e45
Compare
|
These changes are not required anymore, am I right @qlrd ? |
scriptpubkey_typereturnp2shwhen usingp2sh-p2wsh#93;Add a check for
p2sh-p2wsh,p2sh-p2wpkhand raise an exception forunknow types.
With this fix i was able to do a proper recognition of nested segwit multisig wallet when using this method to load a descriptor.