Check the Zcash consensus branch used for the next block

At an upgrade boundary the branch active at the current tip can differ from the branch expected for the next block. A transaction-signing test needs the branch appropriate to its target.

Record both branch IDs

Query a synced node on the network under test and retain the tip hash alongside both IDs. In a fixture one block before activation, the two branch values can legitimately differ.

zcash-cli getblockchaininfo | jq '{blocks, bestblockhash, chaintip: .consensus.chaintip, nextblock: .consensus.nextblock}'

Separate a boundary from a node mismatch

Inspect the upgrades map for the activation height and branch on this network. Re-read the tip after advancing the test chain. A branch value captured before the boundary should not be cached indefinitely. A matching branch alone cannot establish that a transaction otherwise satisfies consensus rules.

zcash.github.io getblockchaininfo