Merge pull request #1546 from zcash/fix-test-feature-flag-issues

Fix various single-crate feature flag issues with tests
This commit is contained in:
Kris Nuttycombe 2024-09-23 10:59:33 -06:00 committed by GitHub
commit 23b955f16a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 10 additions and 5 deletions

View File

@ -28,6 +28,7 @@ proptest = { workspace = true, optional = true }
[dev-dependencies]
assert_matches.workspace = true
proptest.workspace = true
[features]
test-dependencies = ["dep:proptest"]

View File

@ -159,7 +159,7 @@ impl super::Container for Address {
}
}
#[cfg(feature = "test-dependencies")]
#[cfg(any(test, feature = "test-dependencies"))]
pub mod testing {
use proptest::{
array::{uniform11, uniform20, uniform32},

View File

@ -1211,7 +1211,7 @@ pub trait WalletRead {
/// These methods expose internal details or unstable interfaces, primarily to enable use
/// of the [`testing`] framework. They should not be used in production software.
#[cfg(any(test, feature = "test-dependencies"))]
#[delegatable_trait]
#[cfg_attr(feature = "test-dependencies", delegatable_trait)]
pub trait WalletTest: InputSource + WalletRead {
/// Returns a vector of transaction summaries.
///

View File

@ -3,7 +3,6 @@
//! Generalised for sharing across the Sapling and Orchard implementations.
use crate::{
error::SqliteClientError,
testing::{db::TestDbFactory, BlockCache},
SAPLING_TABLES_PREFIX,
};
@ -17,6 +16,9 @@ use {
zcash_client_backend::data_api::testing::orchard::OrchardPoolTester,
};
#[cfg(feature = "transparent-inputs")]
use crate::error::SqliteClientError;
pub(crate) trait ShieldedPoolPersistence {
const TABLES_PREFIX: &'static str;
}

View File

@ -6,7 +6,7 @@
use crate::address::UnifiedAddress;
use bs58::{self, decode::Error as Bs58Error};
use std::fmt;
use zcash_primitives::consensus::{NetworkConstants, NetworkType};
use zcash_primitives::consensus::NetworkConstants;
use zcash_address::unified::{self, Encoding};
use zcash_primitives::{consensus, legacy::TransparentAddress};
@ -16,6 +16,7 @@ use {
bech32::{self, Error, FromBase32, ToBase32, Variant},
sapling::zip32::{ExtendedFullViewingKey, ExtendedSpendingKey},
std::io::{self, Write},
zcash_primitives::consensus::NetworkType,
};
#[cfg(feature = "sapling")]

View File

@ -96,6 +96,7 @@ assert_matches.workspace = true
rand_xorshift.workspace = true
sapling = { workspace = true, features = ["test-dependencies"] }
orchard = { workspace = true, features = ["test-dependencies"] }
zcash_protocol = { workspace = true, features = ["test-dependencies"] }
# MSRV pins for transitive dev-dependencies:
clap = ">=4, <4.5" # clap 4.5 has MSRV 1.74

View File

@ -4,7 +4,7 @@ pub mod amount {
BalanceError, ZatBalance as Amount, Zatoshis as NonNegativeAmount, COIN,
};
#[cfg(feature = "test-dependencies")]
#[cfg(any(test, feature = "test-dependencies"))]
pub mod testing {
pub use zcash_protocol::value::testing::{
arb_positive_zat_balance as arb_positive_amount, arb_zat_balance as arb_amount,