From fc82801d3d37120ad59d7ae2b83abd20fb327bb9 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 12 Jan 2022 11:10:07 -0700 Subject: [PATCH] Update v5 transparent signature hashes to always commit to scriptPubKey --- zcash_primitives/src/legacy.rs | 4 ++-- .../transaction/components/transparent/builder.rs | 7 ++++--- zcash_primitives/src/transaction/sighash.rs | 5 +++-- zcash_primitives/src/transaction/sighash_v5.rs | 6 +++--- zcash_primitives/src/transaction/tests.rs | 15 +++++++++------ 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/zcash_primitives/src/legacy.rs b/zcash_primitives/src/legacy.rs index 67c35d401..1e276afe8 100644 --- a/zcash_primitives/src/legacy.rs +++ b/zcash_primitives/src/legacy.rs @@ -94,8 +94,8 @@ impl Shl<&[u8]> for Script { /// A transparent address corresponding to either a public key or a `Script`. #[derive(Debug, PartialEq, PartialOrd, Hash, Clone)] pub enum TransparentAddress { - PublicKey([u8; 20]), - Script([u8; 20]), + PublicKey([u8; 20]), // TODO: Rename to PublicKeyHash + Script([u8; 20]), // TODO: Rename to ScriptHash } impl TransparentAddress { diff --git a/zcash_primitives/src/transaction/components/transparent/builder.rs b/zcash_primitives/src/transaction/components/transparent/builder.rs index a4d0d10c4..a18db1b4f 100644 --- a/zcash_primitives/src/transaction/components/transparent/builder.rs +++ b/zcash_primitives/src/transaction/components/transparent/builder.rs @@ -194,7 +194,7 @@ impl TransparentAuthorizingContext for Unauthorized { vec![] } - fn input_scripts(&self) -> Vec