Commit e9371ee
committed
feat(wasm-utxo): expose ZEC branch ID APIs on ZcashBitGoPsbt
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-35191 parent f354d6e commit e9371ee
2 files changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
267 | 283 | | |
268 | 284 | | |
269 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
964 | 975 | | |
965 | 976 | | |
966 | 977 | | |
| |||
1943 | 1954 | | |
1944 | 1955 | | |
1945 | 1956 | | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
0 commit comments