The test vectors include explicit values for simple fields like pubkeys
and signatures, and lengths of variable-length composite fields like
Sapling Spends and Sprout JSDescriptions.
The test vectors include explicit values for simple fields like anchors
and signatures, and lengths of variable-length composite fields like
Sapling Spends and Orchard Actions. As the v5 transaction format always
ends with either a simple field (`bindingSigOrchard`) or a zero-length
composite field (`nActionsOrchard`), these test vectors are sufficient
to ensure correct parsing of the entire transaction.
We weren't generating negative value balances, which meant we missed
bugs where value balances were being serialized as u64 instead of i64.
The change to make some value balances negative causes some ZIP 243 and
ZIP 244 test vector sighashes to change (as expected).
As of this commit, this only affects the Sapling test vectors (we still sample the same
randomness to avoid disturbing the others).
A "diversifier_index" field is added to the Unified Address test vectors. (This is not needed
for UIVKs/UFVKs since they do not depend on the diversifier index for any protocol.)
We also add an "account" field to make the account number explicit, even though it could be
inferred from the test vector index.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Also, the height in coinbase needs to match nExpiryHeight.
Co-authored-by: Jack Grigg <str4d@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>