Skip to content

Conversation

thunderbiscuit
Copy link
Member

This is just to break the tests ice and add some unit tests. I'll rename the "Offline" tests since for now they will all be independent of any outside networks like Signet or Testnet 4.

Copy link
Collaborator

@ItoroD ItoroD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is AWESOME!

Network.REGTEST
)
val descriptor2: Descriptor = Descriptor(
"wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/86h/1h/1h/0/*)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is for WPKH I would think the path should be m/84 not m/86.

I am a bit surprised this worked.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the rest as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops yep.

The reason why it works is that these bips are simply conventions. You can use any path you want. And this is what makes those strings dangerous to build manually; we see mistakes like this everywhere, even with very advanced bitcoin devs. This is why BDK developed the descriptor templates.

Good catch!

Network.TESTNET
)
val descriptor3: Descriptor = Descriptor(
"tr(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/86h/1h/1h/0/*)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make the actual string of the paths constants too. I imagine we will be repeating them every where maybe in new tests too. (Thinking out loud)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I actually like that idea. Let me push some new stuff to potentially clean this up.

@thunderbiscuit thunderbiscuit force-pushed the test/add-unit-tests branch 2 times, most recently from ccb0227 to da92a03 Compare August 29, 2025 17:31
Copy link
Collaborator

@ItoroD ItoroD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK da92a03

@thunderbiscuit thunderbiscuit merged commit 7201233 into master Aug 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants