feat(wasm-utxo): expose ZEC branch ID APIs on ZcashBitGoPsbt#296
Draft
OttoAllmendinger wants to merge 1 commit into
Draft
feat(wasm-utxo): expose ZEC branch ID APIs on ZcashBitGoPsbt#296OttoAllmendinger wants to merge 1 commit into
OttoAllmendinger wants to merge 1 commit into
Conversation
Adds consensus_branch_id() to the wasm_bindgen BitGoPsbt impl (Zcash
variant only; returns None for non-ZEC PSBTs). Adds a
zcash_branch_id_for_height() free function wrapping the existing Rust
branch_id_for_height, returning a Result so it throws on unrecognised
network strings ("zcash"/"zec" for mainnet, "zcashTest"/"tzec" for
testnet — anything else is an error).
TypeScript ZcashBitGoPsbt gains:
consensusBranchId: number | undefined — reads the branch ID stored in
the PSBT proprietary map (absent for v5 or non-ZEC PSBTs).
static branchIdForHeight(network, height): number | undefined — returns
the consensus branch ID active at a given chain height.
These APIs allow callers (e.g. ims-utxo parse path) to validate a PSBT's
consensus branch ID against the current chain height without importing
@bitgo-beta/utxo-lib.
Refs: T1-3519
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
consensus_branch_id()to the#[wasm_bindgen] impl BitGoPsbt(Zcash variant only; returnsNonefor non-ZEC PSBTs). Adds azcash_branch_id_for_height()free function that wraps the existing Rustbranch_id_for_height, returning aResultso it throws on unrecognised network strings — only"zcash"/"zec"(mainnet) and"zcashTest"/"tzec"(testnet) are accepted.TypeScript
ZcashBitGoPsbtgains:consensusBranchId: number | undefined— reads the branch ID from the PSBT proprietary map (absent for v5 or non-ZEC PSBTs)static branchIdForHeight(network, height): number | undefined— returns the consensus branch ID active at a given chain heightThese APIs let callers (e.g. ims-utxo parse path) validate a PSBT's consensus branch ID against the current chain height without importing
@bitgo-beta/utxo-lib.Refs: T1-3519