-
Notifications
You must be signed in to change notification settings - Fork 49
common: add taproot singlesig descriptor support #146
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: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1723,6 +1723,31 @@ mod tests { | |
| } | ||
| } | ||
|
|
||
| #[test] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Write a e2e test (in lwk_wollet/src) that receives, check balance and sends using that descriptor.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added e2e test in |
||
| fn taproot_singlesig_desc_format() { | ||
| let mnemonic = lwk_test_util::TEST_MNEMONIC; | ||
|
|
||
| for is_mainnet in [false, true] { | ||
| let signer = SwSigner::new(mnemonic, is_mainnet).unwrap(); | ||
| for blinding_variant in [ | ||
| DescriptorBlindingKey::Slip77, | ||
| DescriptorBlindingKey::Elip151, | ||
| ] { | ||
| let desc_str = | ||
| singlesig_desc(&signer, Singlesig::Taproot, blinding_variant).unwrap(); | ||
| assert!(desc_str.contains("eltr("), "desc: {desc_str}"); | ||
| assert!(desc_str.contains("86h/"), "desc: {desc_str}"); | ||
| assert!(desc_str.contains("/<0;1>/*)"), "desc: {desc_str}"); | ||
|
|
||
| let expected_coin = if is_mainnet { "1776h" } else { "1h" }; | ||
| assert!(desc_str.contains(expected_coin), "desc: {desc_str}"); | ||
|
|
||
| // Verify the descriptor parses into a valid WolletDescriptor | ||
| let _: WolletDescriptor = desc_str.parse().unwrap(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_wollet_status() { | ||
| let bytes = lwk_test_util::update_test_vector_bytes(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop all changes that are not in lwk_wollet lwk_common or lwk_signer.
First we do the internal then (separate MR) we expose that in bindings/wasm/app/cli.
If hww supports it, we can add it there, but we need test coverage there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done — removed both lwk_app changes (address generation arm and wallet type detection). Internal implementation in lwk_wollet, lwk_common, and lwk_signer is unchanged. Will open a follow-up MR for the app/bindings/CLI exposure with test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of them are still here.
Am I talking to Claude?