Commit 06a6111
committed
feat(wasm-utxo): add BitGoPsbt.combineInputs for raw PSBT merge
Adds `combine_inputs` (Rust/WASM) and `combineInputs` (JS/TS) to
`BitGoPsbt`. This method merges all input fields from a raw PSBT
(provided as bytes) into the current PSBT. Unlike `combineMusig2Nonces`,
it handles all script types and works with stripped PSBTs:
- Parses the source with bitcoin's base PSBT deserializer for non-ZEC
coins; for ZEC uses a new `ZcashBitGoPsbt::deserialize_stripped` that
applies the ZEC-aware transaction converter but skips the
`ZecConsensusBranchId` proprietary-key requirement.
- Dispatches on the `BitGoPsbt` enum variant so ZEC PSBTs are parsed
correctly without requiring coin information at call sites.
- Copies per input: partial_sigs, tap_key_sig, tap_script_sigs,
proprietary.
Used by ims-utxo to combine an HSM-signed response PSBT with the full
request PSBT before verifying and finalizing the transaction.
Tests cover BTC (p2shP2wsh), LTC, ZEC, and ZcashBitGoPsbt metadata in
a consolidated `test/fixedScript/combineInputs.ts`.
Refs: T1-36071 parent 1d5845f commit 06a6111
5 files changed
Lines changed: 383 additions & 3 deletions
File tree
- packages/wasm-utxo
- js/fixedScriptWallet
- src
- fixed_script_wallet/bitgo_psbt
- wasm/fixed_script_wallet
- test/fixedScript
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
934 | 950 | | |
935 | 951 | | |
936 | 952 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1300 | 1300 | | |
1301 | 1301 | | |
1302 | 1302 | | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1303 | 1349 | | |
1304 | 1350 | | |
1305 | 1351 | | |
| |||
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
| 221 | + | |
211 | 222 | | |
212 | 223 | | |
213 | 224 | | |
| |||
342 | 353 | | |
343 | 354 | | |
344 | 355 | | |
345 | | - | |
| 356 | + | |
346 | 357 | | |
347 | 358 | | |
348 | 359 | | |
| |||
366 | 377 | | |
367 | 378 | | |
368 | 379 | | |
369 | | - | |
| 380 | + | |
370 | 381 | | |
371 | 382 | | |
372 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
974 | | - | |
975 | 974 | | |
976 | 975 | | |
977 | 976 | | |
| |||
1816 | 1815 | | |
1817 | 1816 | | |
1818 | 1817 | | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
1819 | 1832 | | |
1820 | 1833 | | |
1821 | 1834 | | |
| |||
0 commit comments