Raise an error in the case that sprout version < 1.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Kris Nuttycombe 2020-12-17 10:08:58 -07:00 committed by Kris Nuttycombe
parent 1dd5a6dbcb
commit 6373e7d053
2 changed files with 6 additions and 4 deletions

View File

@ -84,8 +84,13 @@ impl TxVersion {
"Unknown transaction format",
)),
}
} else {
} else if version >= 1 {
Ok(TxVersion::Sprout(version))
} else {
Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Unknown transaction format",
))
}
}

View File

@ -5,9 +5,6 @@ use proptest::prelude::*;
use crate::{constants::SPENDING_KEY_GENERATOR, redjubjub::PrivateKey};
#[cfg(all(feature = "test-dependencies", feature = "zfuture"))]
use crate::consensus::BranchId;
use super::{
components::Amount,
sighash::{signature_hash, SignableInput},