Repository navigation
fix(bitcoin-adapter): initialize ECC lib for Taproot PSBT finalization - #1149
Conversation
Taproot key-path finalization requires an ECC library; without it bitcoinjs-lib throws 'No ECC Library provided'. Also skip inputs the wallet already finalized, which otherwise throw 'Can not finalize input #0' (OKX autoFinalized). Fixes INT2-1684, FE-8536
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @pedromcunha's task in 25s —— View job Code Review
Code Review — No issues found. Reviewed 4 files, 27 additions / 1 deletion. Checked for correctness, security, error handling, and repo guidelines compliance. The fix is correct and well-scoped:
A couple of minor, non-blocking observations (not issues):
|
|
| bitcoin.initEccLib(ecc) | ||
| // Some wallets return already-finalized inputs; re-finalizing a Taproot input throws. | ||
| signedPsbt.data.inputs.forEach((input, index) => { | ||
| if (!input.finalScriptSig && !input.finalScriptWitness) { | ||
| signedPsbt.finalizeInput(index) | ||
| } | ||
| }) |
There was a problem hiding this comment.
There are no automated tests for the two paths changed here: finalizing a signed Taproot input after ECC initialization, and extracting a transaction when the wallet has already finalized an input. The adapter has no test script, and PR CI runs only the SDK tests, so a recurrence of either reported failure would go undetected. Greptile automatically discovered related tickets stating that both the UniSat Taproot and OKX finalized-input fixes need regression coverage, which informed this comment.
Source Used: Linear — UniSat Taproot swaps fail before broadcast
Source Used: Linear — OKX Taproot PSBTs fail during finalization
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Claude finished @pedromcunha's task in 34s —— View job 📝 Docs Drift Check — No docs impact This PR does not touch surfaces that require a |
Taproot key-path finalization requires an ECC library; without it bitcoinjs-lib throws 'No ECC Library provided'. Also skip inputs the wallet already finalized, which otherwise throw 'Can not finalize input #0' (OKX autoFinalized).
Fixes INT2-1684, FE-8536