From 91e9148921f65fc34642d6b9ac4608ff841a194f Mon Sep 17 00:00:00 2001 From: Ranjna Ganesh Ram Date: Wed, 14 Oct 2026 11:09:39 +0530 Subject: [PATCH] feat(wasm-utxo): accept NU7 consensus branch id in create_zcash_v6 Extend the v6 branch-id validation to accept NU7 in addition to NU6.3, since v6 transactions are valid at or after NU6.3 activation. Ticket: CSHLD-788 --- .../wasm-utxo/cli/src/psbt/create_zcash_v6.rs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/wasm-utxo/cli/src/psbt/create_zcash_v6.rs b/packages/wasm-utxo/cli/src/psbt/create_zcash_v6.rs index ed4be4cb7cd..587bb7406b0 100644 --- a/packages/wasm-utxo/cli/src/psbt/create_zcash_v6.rs +++ b/packages/wasm-utxo/cli/src/psbt/create_zcash_v6.rs @@ -14,15 +14,22 @@ pub fn handle_create_zcash_v6_command( let consensus_branch_id = parse_u32_flexible(&consensus_branch_id).context("invalid --consensus-branch-id")?; - // v6 (Ironwood) is only valid at or after NU6.3 activation, and NU6.3 is currently the - // latest defined upgrade — so the only branch id that satisfies "at or after" today is - // NU6.3's own. Reject anything else rather than building an unshieldable PSBT the CLI's - // later steps would fail on with a less obvious error. - let nu6_3_branch_id = NetworkUpgrade::Nu6_3.branch_id(); - if consensus_branch_id != nu6_3_branch_id { + // v6 (Ironwood) is only valid at or after NU6.3 activation. Reject any branch id that + // doesn't correspond to NU6.3 or later, rather than building a PSBT the CLI's later steps + // would fail on with a less obvious error. + let valid_branch_ids: &[u32] = &[ + NetworkUpgrade::Nu6_3.branch_id(), + NetworkUpgrade::Nu7.branch_id(), + ]; + if !valid_branch_ids.contains(&consensus_branch_id) { bail!( "--consensus-branch-id 0x{consensus_branch_id:08x} is not at or after NU6.3 \ - (Ironwood) activation (expected 0x{nu6_3_branch_id:08x})" + (Ironwood) activation (expected one of: {})", + valid_branch_ids + .iter() + .map(|id| format!("0x{id:08x}")) + .collect::>() + .join(", ") ); }