Repository navigation
Conversation
e273adb to
792d066
Compare
|
Thxs for finding @Garrysoon. Some nits:
AFAIK this is (or could -- i don't have opinions on that) already being addressed on embit#87. Let's wait @odudex and @notTanveer can confirm the trim fix you proposed. |
792d066 to
f79a903
Compare
done |
|
Please adapt the PR to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/silent-payments #887 +/- ##
=====================================================
Coverage 97.20% 97.21%
=====================================================
Files 84 84
Lines 11145 11158 +13
=====================================================
+ Hits 10834 10847 +13
Misses 311 311 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Preserve PSBTv2 version and v2-specific fields during signing. Fixes silent v2->v0 downgrade when signing with trim=True (QR mode). Changes: - Pass version=self.psbt.version to PSBT constructor in trim() - Copy tx_version, locktime from original PSBT - Copy v2 input fields: txid, vout, sequence - Copy v2 output fields: value, script_pubkey - Replace hardcoded mnemonic with TEST_MNEMONIC constant Adds 6 tests for PSBTv2 parse, serialize, trim, and backward compatibility.
f79a903 to
c141410
Compare
Problem
When signing a PSBTv2 file, Krux silently downgraded it to v0. The
trim()method inpsbt.pycreatedPSBT(self.psbt.tx)without passing theversionparameter — embit defaults to v0, dropping all v2-specific fields:tx_version,locktime,input_count,output_counttxid,vout,sequencevalue,script_pubkeyThis meant a signed PSBTv2 sent back to Sparrow would be parsed as v0, potentially causing issues with transaction assembly.
Solution
Pass
version=self.psbt.versionto the PSBT constructor intrim(), and copy v2-specific fields from the original PSBT when present.Changes
src/krux/psbt.pytrim()preserves PSBTv2 version and v2 fieldstests/test_psbtv2.pyHow it works