Skip to content

fix(wasm-utxo): skip empty bip32Derivation when resolving PSBT input descriptors#285

Merged
veetragjain merged 1 commit into
masterfrom
veetragjain/cshld-909-add-client-side-verification-for-reclaim-transaction
May 27, 2026
Merged

fix(wasm-utxo): skip empty bip32Derivation when resolving PSBT input descriptors#285
veetragjain merged 1 commit into
masterfrom
veetragjain/cshld-909-add-client-side-verification-for-reclaim-transaction

Conversation

@veetragjain
Copy link
Copy Markdown
Contributor

@veetragjain veetragjain commented May 26, 2026

Empty bip32Derivation arrays are truthy in JavaScript, so getDerivationPaths
previously returned no paths instead of checking tapBip32Derivation. Skip empty
derivation arrays and continue to the next source.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 26, 2026

CSHLD-909

@veetragjain veetragjain marked this pull request as ready for review May 26, 2026 16:20
@veetragjain veetragjain requested a review from a team as a code owner May 26, 2026 16:20
@veetragjain veetragjain enabled auto-merge May 26, 2026 16:22
function getDerivationPaths(v: WithBip32Derivation | WithTapBip32Derivation): string[] | undefined {
if ("bip32Derivation" in v && v.bip32Derivation) {
return v.bip32Derivation.map((v) => v.path);
if (!Array.isArray(v.bip32Derivation) || v.bip32Derivation.length > 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why !Array.isArray here?

wouldn't extending the conditional with && v.bip32Derivation.length > 0 in the preceding line do it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was working with js files and did not see a type there so added array check there and copied the change here. We already have type checks here, so adding the Array check does not help. Changed the condition.

@veetragjain veetragjain force-pushed the veetragjain/cshld-909-add-client-side-verification-for-reclaim-transaction branch from 1e3cff3 to f19106a Compare May 26, 2026 20:12
@veetragjain veetragjain merged commit 049be6f into master May 27, 2026
17 checks passed
@veetragjain veetragjain deleted the veetragjain/cshld-909-add-client-side-verification-for-reclaim-transaction branch May 27, 2026 07:18
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