feat(abstract-utxo): add zec shielded psbt decode and recipient resolution support - #9642
Conversation
|
|
17cba91 to
c0b5ca0
Compare
c0b5ca0 to
d3a9a4f
Compare
| /** | ||
| * Custom change wallet xpubs, when the transaction spends to a custom change wallet. Outputs | ||
| * matching these keys are classified as change, not recipients — matching how | ||
| * `explainPsbtWasm` treats them. | ||
| */ | ||
| customChangeXpubs?: Triple<string>; |
There was a problem hiding this comment.
we don't need to support custom change wallets, let's leave this unimplemented and fail hard if a custom change wallet is configured
| try { | ||
| return fixedScriptWallet.ZcashUnifiedAddress.parse(address, network); | ||
| } catch (e) { | ||
| return undefined; |
There was a problem hiding this comment.
we should prefer failing hard instead
| address: string, | ||
| param?: { anyFormat?: boolean; allowLightning?: boolean } | boolean | ||
| ): boolean { | ||
| const unifiedAddress = tryParseUnifiedAddress(address, this.name as 'zec' | 'tzec'); |
There was a problem hiding this comment.
this seems to be the only site where we use the undefined returning func, I'd rather inline the catch here
| // `ZcashBitGoPsbt.fromBytes` signals v6 (Ironwood) bytes with a plain Error (not a | ||
| // WasmUtxoError) telling the caller to use `ZcashIronwoodBitGoPsbt.fromBytes` instead — | ||
| // see its doc comment. Fall back for that message as well as wasm-layer errors. | ||
| if (isWasmUtxoError(e) || (e instanceof Error && e.message.includes('v6 (Ironwood)'))) { |
There was a problem hiding this comment.
This is a brittle way to identify errors. We have a more structured system for categorizing errors in wasm-utxo already, please check if we can already use it. If not, submit a change for wasm-utxo so we have a proper error code here instead and let's fix it in a follow-up.
Ticket: CSHLD-1640