From f8a24f9c11f243ba301542a296b0a71596d1c82b Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Mon, 10 Aug 2020 11:49:38 -0700 Subject: [PATCH] Rename script fields to lock/unlock scripts. (#866) This is slightly clearer and more correct than the previous pk_script. --- zebra-chain/src/transaction/serialize.rs | 10 +++++----- zebra-chain/src/transaction/tests/arbitrary.rs | 4 ++-- zebra-chain/src/transaction/transparent.rs | 7 +++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/zebra-chain/src/transaction/serialize.rs b/zebra-chain/src/transaction/serialize.rs index 796106b83..b86368f48 100644 --- a/zebra-chain/src/transaction/serialize.rs +++ b/zebra-chain/src/transaction/serialize.rs @@ -157,11 +157,11 @@ impl ZcashSerialize for TransparentInput { match self { TransparentInput::PrevOut { outpoint, - script, + unlock_script, sequence, } => { outpoint.zcash_serialize(&mut writer)?; - script.zcash_serialize(&mut writer)?; + unlock_script.zcash_serialize(&mut writer)?; writer.write_u32::(*sequence)?; } TransparentInput::Coinbase { @@ -211,7 +211,7 @@ impl ZcashDeserialize for TransparentInput { hash: TransactionHash(bytes), index: reader.read_u32::()?, }, - script: Script::zcash_deserialize(&mut reader)?, + unlock_script: Script::zcash_deserialize(&mut reader)?, sequence: reader.read_u32::()?, }) } @@ -221,7 +221,7 @@ impl ZcashDeserialize for TransparentInput { impl ZcashSerialize for TransparentOutput { fn zcash_serialize(&self, mut writer: W) -> Result<(), io::Error> { writer.write_u64::(self.value.into())?; - self.pk_script.zcash_serialize(&mut writer)?; + self.lock_script.zcash_serialize(&mut writer)?; Ok(()) } } @@ -230,7 +230,7 @@ impl ZcashDeserialize for TransparentOutput { fn zcash_deserialize(mut reader: R) -> Result { Ok(TransparentOutput { value: reader.read_u64::()?.try_into()?, - pk_script: Script::zcash_deserialize(&mut reader)?, + lock_script: Script::zcash_deserialize(&mut reader)?, }) } } diff --git a/zebra-chain/src/transaction/tests/arbitrary.rs b/zebra-chain/src/transaction/tests/arbitrary.rs index beafaaa44..4d5cc1859 100644 --- a/zebra-chain/src/transaction/tests/arbitrary.rs +++ b/zebra-chain/src/transaction/tests/arbitrary.rs @@ -202,10 +202,10 @@ impl Arbitrary for TransparentInput { fn arbitrary_with(_args: ()) -> Self::Strategy { prop_oneof![ (any::(), any::