Rename `Future -> ZFuture`
Proactively distinguish against future use of the futures crate for source greppability.
This commit is contained in:
parent
a0a36eddfd
commit
99eb5b9336
|
@ -88,7 +88,7 @@ impl<'a> demo::Context for Context<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Identifier for the set of TZEs associated with the FUTURE network upgrade.
|
/// Identifier for the set of TZEs associated with the ZFUTURE network upgrade.
|
||||||
/// This epoch is intended only for use on test networks.
|
/// This epoch is intended only for use on test networks.
|
||||||
struct EpochVTest;
|
struct EpochVTest;
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ impl Epoch for EpochVTest {
|
||||||
pub fn epoch_for_branch(network_upgrade: NetworkUpgrade) -> Option<Box<dyn Epoch<Error = String>>> {
|
pub fn epoch_for_branch(network_upgrade: NetworkUpgrade) -> Option<Box<dyn Epoch<Error = String>>> {
|
||||||
// Map from consensus branch IDs to epochs.
|
// Map from consensus branch IDs to epochs.
|
||||||
match network_upgrade {
|
match network_upgrade {
|
||||||
NetworkUpgrade::Future => Some(Box::new(EpochVTest)),
|
NetworkUpgrade::ZFuture => Some(Box::new(EpochVTest)),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ impl Parameters for MainNetwork {
|
||||||
NetworkUpgrade::Blossom => Some(BlockHeight(653_600)),
|
NetworkUpgrade::Blossom => Some(BlockHeight(653_600)),
|
||||||
NetworkUpgrade::Heartwood => Some(BlockHeight(903_000)),
|
NetworkUpgrade::Heartwood => Some(BlockHeight(903_000)),
|
||||||
NetworkUpgrade::Canopy => Some(BlockHeight(1_046_400)),
|
NetworkUpgrade::Canopy => Some(BlockHeight(1_046_400)),
|
||||||
NetworkUpgrade::Future => None,
|
NetworkUpgrade::ZFuture => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ impl Parameters for TestNetwork {
|
||||||
NetworkUpgrade::Blossom => Some(BlockHeight(584_000)),
|
NetworkUpgrade::Blossom => Some(BlockHeight(584_000)),
|
||||||
NetworkUpgrade::Heartwood => Some(BlockHeight(903_800)),
|
NetworkUpgrade::Heartwood => Some(BlockHeight(903_800)),
|
||||||
NetworkUpgrade::Canopy => Some(BlockHeight(1_028_500)),
|
NetworkUpgrade::Canopy => Some(BlockHeight(1_028_500)),
|
||||||
NetworkUpgrade::Future => None,
|
NetworkUpgrade::ZFuture => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,12 +289,12 @@ pub enum NetworkUpgrade {
|
||||||
///
|
///
|
||||||
/// [Canopy]: https://z.cash/upgrade/canopy/
|
/// [Canopy]: https://z.cash/upgrade/canopy/
|
||||||
Canopy,
|
Canopy,
|
||||||
/// The [FUTURE] network upgrade.
|
/// The [ZFUTURE] network upgrade.
|
||||||
///
|
///
|
||||||
/// This upgrade is expected never to activate on mainnet;
|
/// This upgrade is expected never to activate on mainnet;
|
||||||
/// it is intended for use in integration testing of functionality
|
/// it is intended for use in integration testing of functionality
|
||||||
/// that is a candidate for integration in a future network upgrade.
|
/// that is a candidate for integration in a future network upgrade.
|
||||||
Future,
|
ZFuture,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for NetworkUpgrade {
|
impl fmt::Display for NetworkUpgrade {
|
||||||
|
@ -305,7 +305,7 @@ impl fmt::Display for NetworkUpgrade {
|
||||||
NetworkUpgrade::Blossom => write!(f, "Blossom"),
|
NetworkUpgrade::Blossom => write!(f, "Blossom"),
|
||||||
NetworkUpgrade::Heartwood => write!(f, "Heartwood"),
|
NetworkUpgrade::Heartwood => write!(f, "Heartwood"),
|
||||||
NetworkUpgrade::Canopy => write!(f, "Canopy"),
|
NetworkUpgrade::Canopy => write!(f, "Canopy"),
|
||||||
NetworkUpgrade::Future => write!(f, "FUTURE"),
|
NetworkUpgrade::ZFuture => write!(f, "ZFUTURE"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ impl NetworkUpgrade {
|
||||||
NetworkUpgrade::Blossom => BranchId::Blossom,
|
NetworkUpgrade::Blossom => BranchId::Blossom,
|
||||||
NetworkUpgrade::Heartwood => BranchId::Heartwood,
|
NetworkUpgrade::Heartwood => BranchId::Heartwood,
|
||||||
NetworkUpgrade::Canopy => BranchId::Canopy,
|
NetworkUpgrade::Canopy => BranchId::Canopy,
|
||||||
NetworkUpgrade::Future => BranchId::Future,
|
NetworkUpgrade::ZFuture => BranchId::ZFuture,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ pub enum BranchId {
|
||||||
Canopy,
|
Canopy,
|
||||||
/// Candidates for future consensus rules; this branch will never
|
/// Candidates for future consensus rules; this branch will never
|
||||||
/// activate on mainnet.
|
/// activate on mainnet.
|
||||||
Future,
|
ZFuture,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<u32> for BranchId {
|
impl TryFrom<u32> for BranchId {
|
||||||
|
@ -380,7 +380,7 @@ impl TryFrom<u32> for BranchId {
|
||||||
0x2bb4_0e60 => Ok(BranchId::Blossom),
|
0x2bb4_0e60 => Ok(BranchId::Blossom),
|
||||||
0xf5b9_230b => Ok(BranchId::Heartwood),
|
0xf5b9_230b => Ok(BranchId::Heartwood),
|
||||||
0xe9ff_75a6 => Ok(BranchId::Canopy),
|
0xe9ff_75a6 => Ok(BranchId::Canopy),
|
||||||
0xffff_ffff => Ok(BranchId::Future),
|
0xffff_ffff => Ok(BranchId::ZFuture),
|
||||||
_ => Err("Unknown consensus branch ID"),
|
_ => Err("Unknown consensus branch ID"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,7 @@ impl From<BranchId> for u32 {
|
||||||
BranchId::Blossom => 0x2bb4_0e60,
|
BranchId::Blossom => 0x2bb4_0e60,
|
||||||
BranchId::Heartwood => 0xf5b9_230b,
|
BranchId::Heartwood => 0xf5b9_230b,
|
||||||
BranchId::Canopy => 0xe9ff_75a6,
|
BranchId::Canopy => 0xe9ff_75a6,
|
||||||
BranchId::Future => 0xffff_ffff,
|
BranchId::ZFuture => 0xffff_ffff,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -363,7 +363,7 @@ impl<'a, P: consensus::Parameters> Builder<'a, P, OsRng> {
|
||||||
|
|
||||||
/// Creates a new `Builder` targeted for inclusion in the block with the given height,
|
/// Creates a new `Builder` targeted for inclusion in the block with the given height,
|
||||||
/// using default values for general transaction fields and the default OS random,
|
/// using default values for general transaction fields and the default OS random,
|
||||||
/// and the `FUTURE_TX_VERSION` and `FUTURE_VERSION_GROUP_ID` version identifiers.
|
/// and the `ZFUTURE_TX_VERSION` and `ZFUTURE_VERSION_GROUP_ID` version identifiers.
|
||||||
///
|
///
|
||||||
/// # Default values
|
/// # Default values
|
||||||
///
|
///
|
||||||
|
@ -372,9 +372,9 @@ impl<'a, P: consensus::Parameters> Builder<'a, P, OsRng> {
|
||||||
///
|
///
|
||||||
/// The fee will be set to the default fee (0.0001 ZEC).
|
/// The fee will be set to the default fee (0.0001 ZEC).
|
||||||
///
|
///
|
||||||
/// The transaction will be constructed and serialized according to the Future
|
/// The transaction will be constructed and serialized according to the
|
||||||
/// network upgrade rules. This is intended only for use in integration testing of
|
/// NetworkUpgrade::ZFuture rules. This is intended only for use in
|
||||||
/// new features.
|
/// integration testing of new features.
|
||||||
pub fn new_future(params: P, height: BlockHeight) -> Self {
|
pub fn new_future(params: P, height: BlockHeight) -> Self {
|
||||||
Builder::new_with_rng_future(params, height, OsRng)
|
Builder::new_with_rng_future(params, height, OsRng)
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ impl<'a, P: consensus::Parameters, R: RngCore + CryptoRng> Builder<'a, P, R> {
|
||||||
|
|
||||||
/// Creates a new `Builder` targeted for inclusion in the block with the given height,
|
/// Creates a new `Builder` targeted for inclusion in the block with the given height,
|
||||||
/// and randomness source, using default values for general transaction fields
|
/// and randomness source, using default values for general transaction fields
|
||||||
/// and the `FUTURE_TX_VERSION` and `FUTURE_VERSION_GROUP_ID` version identifiers.
|
/// and the `ZFUTURE_TX_VERSION` and `ZFUTURE_VERSION_GROUP_ID` version identifiers.
|
||||||
///
|
///
|
||||||
/// # Default values
|
/// # Default values
|
||||||
///
|
///
|
||||||
|
@ -405,9 +405,9 @@ impl<'a, P: consensus::Parameters, R: RngCore + CryptoRng> Builder<'a, P, R> {
|
||||||
///
|
///
|
||||||
/// The fee will be set to the default fee (0.0001 ZEC).
|
/// The fee will be set to the default fee (0.0001 ZEC).
|
||||||
///
|
///
|
||||||
/// The transaction will be constructed and serialized according to the Future
|
/// The transaction will be constructed and serialized according to the
|
||||||
/// network upgrade rules. This is intended only for use in integration testing of
|
/// NetworkUpgrade::ZFuture rules. This is intended only for use in
|
||||||
/// new features.
|
/// integration testing of new features.
|
||||||
pub fn new_with_rng_future(params: P, height: BlockHeight, rng: R) -> Builder<'a, P, R> {
|
pub fn new_with_rng_future(params: P, height: BlockHeight, rng: R) -> Builder<'a, P, R> {
|
||||||
Self::new_with_mtx(params, height, rng, TransactionData::future())
|
Self::new_with_mtx(params, height, rng, TransactionData::future())
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ const SAPLING_TX_VERSION: u32 = 4;
|
||||||
/// using these constants should be inspected, and use of these constants
|
/// using these constants should be inspected, and use of these constants
|
||||||
/// should be removed as appropriate in favor of the new consensus
|
/// should be removed as appropriate in favor of the new consensus
|
||||||
/// transaction version and group.
|
/// transaction version and group.
|
||||||
const FUTURE_VERSION_GROUP_ID: u32 = 0xFFFFFFFF;
|
const ZFUTURE_VERSION_GROUP_ID: u32 = 0xFFFFFFFF;
|
||||||
const FUTURE_TX_VERSION: u32 = 0x0000FFFF;
|
const ZFUTURE_TX_VERSION: u32 = 0x0000FFFF;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
#[derive(Clone, Copy, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
||||||
pub struct TxId(pub [u8; 32]);
|
pub struct TxId(pub [u8; 32]);
|
||||||
|
@ -152,8 +152,8 @@ impl TransactionData {
|
||||||
pub fn future() -> Self {
|
pub fn future() -> Self {
|
||||||
TransactionData {
|
TransactionData {
|
||||||
overwintered: true,
|
overwintered: true,
|
||||||
version: FUTURE_TX_VERSION,
|
version: ZFUTURE_TX_VERSION,
|
||||||
version_group_id: FUTURE_VERSION_GROUP_ID,
|
version_group_id: ZFUTURE_VERSION_GROUP_ID,
|
||||||
vin: vec![],
|
vin: vec![],
|
||||||
vout: vec![],
|
vout: vec![],
|
||||||
tze_inputs: vec![],
|
tze_inputs: vec![],
|
||||||
|
@ -219,8 +219,8 @@ impl Transaction {
|
||||||
&& version_group_id == SAPLING_VERSION_GROUP_ID
|
&& version_group_id == SAPLING_VERSION_GROUP_ID
|
||||||
&& version == SAPLING_TX_VERSION;
|
&& version == SAPLING_TX_VERSION;
|
||||||
let has_tze = overwintered
|
let has_tze = overwintered
|
||||||
&& version_group_id == FUTURE_VERSION_GROUP_ID
|
&& version_group_id == ZFUTURE_VERSION_GROUP_ID
|
||||||
&& version == FUTURE_TX_VERSION;
|
&& version == ZFUTURE_TX_VERSION;
|
||||||
|
|
||||||
if overwintered && !(is_overwinter_v3 || is_sapling_v4 || has_tze) {
|
if overwintered && !(is_overwinter_v3 || is_sapling_v4 || has_tze) {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
|
@ -319,8 +319,8 @@ impl Transaction {
|
||||||
&& self.version_group_id == SAPLING_VERSION_GROUP_ID
|
&& self.version_group_id == SAPLING_VERSION_GROUP_ID
|
||||||
&& self.version == SAPLING_TX_VERSION;
|
&& self.version == SAPLING_TX_VERSION;
|
||||||
let has_tze = self.overwintered
|
let has_tze = self.overwintered
|
||||||
&& self.version_group_id == FUTURE_VERSION_GROUP_ID
|
&& self.version_group_id == ZFUTURE_VERSION_GROUP_ID
|
||||||
&& self.version == FUTURE_TX_VERSION;
|
&& self.version == ZFUTURE_TX_VERSION;
|
||||||
|
|
||||||
if self.overwintered && !(is_overwinter_v3 || is_sapling_v4 || has_tze) {
|
if self.overwintered && !(is_overwinter_v3 || is_sapling_v4 || has_tze) {
|
||||||
return Err(io::Error::new(
|
return Err(io::Error::new(
|
||||||
|
|
|
@ -5,8 +5,8 @@ use group::GroupEncoding;
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
components::{Amount, TxOut},
|
components::{Amount, TxOut},
|
||||||
Transaction, TransactionData, FUTURE_VERSION_GROUP_ID, OVERWINTER_VERSION_GROUP_ID,
|
Transaction, TransactionData, OVERWINTER_VERSION_GROUP_ID, SAPLING_TX_VERSION,
|
||||||
SAPLING_TX_VERSION, SAPLING_VERSION_GROUP_ID,
|
SAPLING_VERSION_GROUP_ID, ZFUTURE_VERSION_GROUP_ID,
|
||||||
};
|
};
|
||||||
use crate::{consensus, extensions::transparent::Precondition, legacy::Script};
|
use crate::{consensus, extensions::transparent::Precondition, legacy::Script};
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ enum SigHashVersion {
|
||||||
Sprout,
|
Sprout,
|
||||||
Overwinter,
|
Overwinter,
|
||||||
Sapling,
|
Sapling,
|
||||||
Future,
|
ZFuture,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SigHashVersion {
|
impl SigHashVersion {
|
||||||
|
@ -60,7 +60,7 @@ impl SigHashVersion {
|
||||||
match tx.version_group_id {
|
match tx.version_group_id {
|
||||||
OVERWINTER_VERSION_GROUP_ID => SigHashVersion::Overwinter,
|
OVERWINTER_VERSION_GROUP_ID => SigHashVersion::Overwinter,
|
||||||
SAPLING_VERSION_GROUP_ID => SigHashVersion::Sapling,
|
SAPLING_VERSION_GROUP_ID => SigHashVersion::Sapling,
|
||||||
FUTURE_VERSION_GROUP_ID => SigHashVersion::Future,
|
ZFUTURE_VERSION_GROUP_ID => SigHashVersion::ZFuture,
|
||||||
_ => unimplemented!(),
|
_ => unimplemented!(),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -220,7 +220,7 @@ pub fn signature_hash_data<'a>(
|
||||||
) -> Vec<u8> {
|
) -> Vec<u8> {
|
||||||
let sigversion = SigHashVersion::from_tx(tx);
|
let sigversion = SigHashVersion::from_tx(tx);
|
||||||
match sigversion {
|
match sigversion {
|
||||||
SigHashVersion::Overwinter | SigHashVersion::Sapling | SigHashVersion::Future => {
|
SigHashVersion::Overwinter | SigHashVersion::Sapling | SigHashVersion::ZFuture => {
|
||||||
let mut personal = [0; 16];
|
let mut personal = [0; 16];
|
||||||
(&mut personal[..12]).copy_from_slice(ZCASH_SIGHASH_PERSONALIZATION_PREFIX);
|
(&mut personal[..12]).copy_from_slice(ZCASH_SIGHASH_PERSONALIZATION_PREFIX);
|
||||||
(&mut personal[12..])
|
(&mut personal[12..])
|
||||||
|
@ -258,12 +258,12 @@ pub fn signature_hash_data<'a>(
|
||||||
} else {
|
} else {
|
||||||
h.update(&[0; 32]);
|
h.update(&[0; 32]);
|
||||||
};
|
};
|
||||||
if sigversion == SigHashVersion::Future {
|
if sigversion == SigHashVersion::ZFuture {
|
||||||
update_hash!(h, !tx.tze_inputs.is_empty(), tze_inputs_hash(tx));
|
update_hash!(h, !tx.tze_inputs.is_empty(), tze_inputs_hash(tx));
|
||||||
update_hash!(h, !tx.tze_outputs.is_empty(), tze_outputs_hash(tx));
|
update_hash!(h, !tx.tze_outputs.is_empty(), tze_outputs_hash(tx));
|
||||||
}
|
}
|
||||||
update_hash!(h, !tx.joinsplits.is_empty(), joinsplits_hash(tx));
|
update_hash!(h, !tx.joinsplits.is_empty(), joinsplits_hash(tx));
|
||||||
if sigversion == SigHashVersion::Sapling || sigversion == SigHashVersion::Future {
|
if sigversion == SigHashVersion::Sapling || sigversion == SigHashVersion::ZFuture {
|
||||||
update_hash!(h, !tx.shielded_spends.is_empty(), shielded_spends_hash(tx));
|
update_hash!(h, !tx.shielded_spends.is_empty(), shielded_spends_hash(tx));
|
||||||
update_hash!(
|
update_hash!(
|
||||||
h,
|
h,
|
||||||
|
@ -273,7 +273,7 @@ pub fn signature_hash_data<'a>(
|
||||||
}
|
}
|
||||||
update_u32!(h, tx.lock_time, tmp);
|
update_u32!(h, tx.lock_time, tmp);
|
||||||
update_u32!(h, tx.expiry_height.into(), tmp);
|
update_u32!(h, tx.expiry_height.into(), tmp);
|
||||||
if sigversion == SigHashVersion::Sapling || sigversion == SigHashVersion::Future {
|
if sigversion == SigHashVersion::Sapling || sigversion == SigHashVersion::ZFuture {
|
||||||
h.update(&tx.value_balance.to_i64_le_bytes());
|
h.update(&tx.value_balance.to_i64_le_bytes());
|
||||||
}
|
}
|
||||||
update_u32!(h, hash_type, tmp);
|
update_u32!(h, hash_type, tmp);
|
||||||
|
@ -284,7 +284,7 @@ pub fn signature_hash_data<'a>(
|
||||||
script_code,
|
script_code,
|
||||||
value,
|
value,
|
||||||
} => {
|
} => {
|
||||||
let mut data = if sigversion == SigHashVersion::Future {
|
let mut data = if sigversion == SigHashVersion::ZFuture {
|
||||||
ZCASH_TRANSPARENT_SIGNED_INPUT_DOMAIN_SEPARATOR.to_vec()
|
ZCASH_TRANSPARENT_SIGNED_INPUT_DOMAIN_SEPARATOR.to_vec()
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
|
@ -303,7 +303,7 @@ pub fn signature_hash_data<'a>(
|
||||||
index,
|
index,
|
||||||
precondition,
|
precondition,
|
||||||
value,
|
value,
|
||||||
} if sigversion == SigHashVersion::Future => {
|
} if sigversion == SigHashVersion::ZFuture => {
|
||||||
let mut data = ZCASH_TZE_SIGNED_INPUT_DOMAIN_SEPARATOR.to_vec();
|
let mut data = ZCASH_TZE_SIGNED_INPUT_DOMAIN_SEPARATOR.to_vec();
|
||||||
|
|
||||||
tx.tze_inputs[index].prevout.write(&mut data).unwrap();
|
tx.tze_inputs[index].prevout.write(&mut data).unwrap();
|
||||||
|
@ -316,7 +316,7 @@ pub fn signature_hash_data<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
SignableInput::Tze { .. } => {
|
SignableInput::Tze { .. } => {
|
||||||
panic!("A request has been made to sign a TZE input, but the signature hash version is not Future");
|
panic!("A request has been made to sign a TZE input, but the signature hash version is not ZFuture");
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => (),
|
_ => (),
|
||||||
|
|
|
@ -13,9 +13,8 @@ use super::{
|
||||||
components::amount::MAX_MONEY,
|
components::amount::MAX_MONEY,
|
||||||
components::{Amount, OutPoint, TxIn, TxOut, TzeIn, TzeOut},
|
components::{Amount, OutPoint, TxIn, TxOut, TzeIn, TzeOut},
|
||||||
sighash::{signature_hash, SignableInput},
|
sighash::{signature_hash, SignableInput},
|
||||||
Transaction, TransactionData, FUTURE_TX_VERSION, FUTURE_VERSION_GROUP_ID,
|
Transaction, TransactionData, OVERWINTER_TX_VERSION, OVERWINTER_VERSION_GROUP_ID,
|
||||||
OVERWINTER_TX_VERSION, OVERWINTER_VERSION_GROUP_ID, SAPLING_TX_VERSION,
|
SAPLING_TX_VERSION, SAPLING_VERSION_GROUP_ID, ZFUTURE_TX_VERSION, ZFUTURE_VERSION_GROUP_ID,
|
||||||
SAPLING_VERSION_GROUP_ID,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
prop_compose! {
|
prop_compose! {
|
||||||
|
@ -77,7 +76,7 @@ fn tx_versions(branch_id: BranchId) -> impl Strategy<Value = (u32, u32)> {
|
||||||
match branch_id {
|
match branch_id {
|
||||||
BranchId::Sprout => (1..(2 as u32)).prop_map(|i| (i, 0)).boxed(),
|
BranchId::Sprout => (1..(2 as u32)).prop_map(|i| (i, 0)).boxed(),
|
||||||
BranchId::Overwinter => Just((OVERWINTER_TX_VERSION, OVERWINTER_VERSION_GROUP_ID)).boxed(),
|
BranchId::Overwinter => Just((OVERWINTER_TX_VERSION, OVERWINTER_VERSION_GROUP_ID)).boxed(),
|
||||||
BranchId::Future => Just((FUTURE_TX_VERSION, FUTURE_VERSION_GROUP_ID)).boxed(),
|
BranchId::ZFuture => Just((ZFUTURE_TX_VERSION, ZFUTURE_VERSION_GROUP_ID)).boxed(),
|
||||||
_otherwise => Just((SAPLING_TX_VERSION, SAPLING_VERSION_GROUP_ID)).boxed(),
|
_otherwise => Just((SAPLING_TX_VERSION, SAPLING_VERSION_GROUP_ID)).boxed(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,8 +97,8 @@ prop_compose! {
|
||||||
version,
|
version,
|
||||||
version_group_id,
|
version_group_id,
|
||||||
vin, vout,
|
vin, vout,
|
||||||
tze_inputs: if branch_id == BranchId::Future { tze_inputs } else { vec![] },
|
tze_inputs: if branch_id == BranchId::ZFuture { tze_inputs } else { vec![] },
|
||||||
tze_outputs: if branch_id == BranchId::Future { tze_outputs } else { vec![] },
|
tze_outputs: if branch_id == BranchId::ZFuture { tze_outputs } else { vec![] },
|
||||||
lock_time,
|
lock_time,
|
||||||
expiry_height: expiry_height.into(),
|
expiry_height: expiry_height.into(),
|
||||||
value_balance,
|
value_balance,
|
||||||
|
@ -178,7 +177,7 @@ fn tx_write_rejects_unexpected_binding_sig() {
|
||||||
|
|
||||||
proptest! {
|
proptest! {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_tze_roundtrip(tx in arb_tx(BranchId::Future)) {
|
fn test_tze_roundtrip(tx in arb_tx(BranchId::ZFuture)) {
|
||||||
let mut txn_bytes = vec![];
|
let mut txn_bytes = vec![];
|
||||||
tx.write(&mut txn_bytes).unwrap();
|
tx.write(&mut txn_bytes).unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue