zcash_client_backend: Move test-only methods to new `WalletTest` trait
This reduces the feature-flag-related `WalletRead` breakage for crate users, and gives us a place to expose even more internal Data Access API implementation details for general testing purposes.
This commit is contained in:
parent
0777cbc2de
commit
bf73a02f45
|
@ -1166,13 +1166,20 @@ pub trait WalletRead {
|
||||||
/// transaction data requests, such as when it is necessary to fill in purely-transparent
|
/// transaction data requests, such as when it is necessary to fill in purely-transparent
|
||||||
/// transaction history by walking the chain backwards via transparent inputs.
|
/// transaction history by walking the chain backwards via transparent inputs.
|
||||||
fn transaction_data_requests(&self) -> Result<Vec<TransactionDataRequest>, Self::Error>;
|
fn transaction_data_requests(&self) -> Result<Vec<TransactionDataRequest>, Self::Error>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Read-only operations required for testing light wallet functions.
|
||||||
|
///
|
||||||
|
/// 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]
|
||||||
|
pub trait WalletTest: WalletRead {
|
||||||
/// Returns a vector of transaction summaries.
|
/// Returns a vector of transaction summaries.
|
||||||
///
|
///
|
||||||
/// Currently test-only, as production use could return a very large number of results; either
|
/// Currently test-only, as production use could return a very large number of results; either
|
||||||
/// pagination or a streaming design will be necessary to stabilize this feature for production
|
/// pagination or a streaming design will be necessary to stabilize this feature for production
|
||||||
/// use.
|
/// use.
|
||||||
#[cfg(any(test, feature = "test-dependencies"))]
|
|
||||||
fn get_tx_history(
|
fn get_tx_history(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<Vec<testing::TransactionSummary<Self::AccountId>>, Self::Error> {
|
) -> Result<Vec<testing::TransactionSummary<Self::AccountId>>, Self::Error> {
|
||||||
|
@ -1181,7 +1188,6 @@ pub trait WalletRead {
|
||||||
|
|
||||||
/// Returns the note IDs for shielded notes sent by the wallet in a particular
|
/// Returns the note IDs for shielded notes sent by the wallet in a particular
|
||||||
/// transaction.
|
/// transaction.
|
||||||
#[cfg(any(test, feature = "test-dependencies"))]
|
|
||||||
fn get_sent_note_ids(
|
fn get_sent_note_ids(
|
||||||
&self,
|
&self,
|
||||||
_txid: &TxId,
|
_txid: &TxId,
|
||||||
|
|
|
@ -56,6 +56,7 @@ use crate::{
|
||||||
ShieldedProtocol,
|
ShieldedProtocol,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use super::WalletTest;
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
use super::{
|
use super::{
|
||||||
chain::{scan_cached_blocks, BlockSource, ChainState, CommitmentTreeRoot, ScanSummary},
|
chain::{scan_cached_blocks, BlockSource, ChainState, CommitmentTreeRoot, ScanSummary},
|
||||||
|
@ -319,14 +320,14 @@ impl<A: Account> Account for TestAccount<A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Reset: WalletRead + Sized {
|
pub trait Reset: WalletTest + Sized {
|
||||||
type Handle;
|
type Handle;
|
||||||
|
|
||||||
fn reset<C>(st: &mut TestState<C, Self, LocalNetwork>) -> Self::Handle;
|
fn reset<C>(st: &mut TestState<C, Self, LocalNetwork>) -> Self::Handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The state for a `zcash_client_sqlite` test.
|
/// The state for a `zcash_client_sqlite` test.
|
||||||
pub struct TestState<Cache, DataStore: WalletRead, Network> {
|
pub struct TestState<Cache, DataStore: WalletTest, Network> {
|
||||||
cache: Cache,
|
cache: Cache,
|
||||||
cached_blocks: BTreeMap<BlockHeight, CachedBlock>,
|
cached_blocks: BTreeMap<BlockHeight, CachedBlock>,
|
||||||
latest_block_height: Option<BlockHeight>,
|
latest_block_height: Option<BlockHeight>,
|
||||||
|
@ -336,7 +337,7 @@ pub struct TestState<Cache, DataStore: WalletRead, Network> {
|
||||||
rng: ChaChaRng,
|
rng: ChaChaRng,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Cache, DataStore: WalletRead, Network> TestState<Cache, DataStore, Network> {
|
impl<Cache, DataStore: WalletTest, Network> TestState<Cache, DataStore, Network> {
|
||||||
/// Exposes an immutable reference to the test's `DataStore`.
|
/// Exposes an immutable reference to the test's `DataStore`.
|
||||||
pub fn wallet(&self) -> &DataStore {
|
pub fn wallet(&self) -> &DataStore {
|
||||||
&self.wallet_data
|
&self.wallet_data
|
||||||
|
@ -358,7 +359,7 @@ impl<Cache, DataStore: WalletRead, Network> TestState<Cache, DataStore, Network>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Cache, DataStore: WalletRead, Network: consensus::Parameters>
|
impl<Cache, DataStore: WalletTest, Network: consensus::Parameters>
|
||||||
TestState<Cache, DataStore, Network>
|
TestState<Cache, DataStore, Network>
|
||||||
{
|
{
|
||||||
/// Convenience method for obtaining the Sapling activation height for the network under test.
|
/// Convenience method for obtaining the Sapling activation height for the network under test.
|
||||||
|
@ -405,7 +406,7 @@ impl<Cache, DataStore: WalletRead, Network: consensus::Parameters>
|
||||||
impl<Cache: TestCache, DataStore, Network> TestState<Cache, DataStore, Network>
|
impl<Cache: TestCache, DataStore, Network> TestState<Cache, DataStore, Network>
|
||||||
where
|
where
|
||||||
Network: consensus::Parameters,
|
Network: consensus::Parameters,
|
||||||
DataStore: WalletWrite,
|
DataStore: WalletTest + WalletWrite,
|
||||||
<Cache::BlockSource as BlockSource>::Error: fmt::Debug,
|
<Cache::BlockSource as BlockSource>::Error: fmt::Debug,
|
||||||
{
|
{
|
||||||
/// Exposes an immutable reference to the test's [`BlockSource`].
|
/// Exposes an immutable reference to the test's [`BlockSource`].
|
||||||
|
@ -697,7 +698,7 @@ where
|
||||||
Cache: TestCache,
|
Cache: TestCache,
|
||||||
<Cache::BlockSource as BlockSource>::Error: fmt::Debug,
|
<Cache::BlockSource as BlockSource>::Error: fmt::Debug,
|
||||||
ParamsT: consensus::Parameters + Send + 'static,
|
ParamsT: consensus::Parameters + Send + 'static,
|
||||||
DbT: InputSource + WalletWrite + WalletCommitmentTrees,
|
DbT: InputSource + WalletTest + WalletWrite + WalletCommitmentTrees,
|
||||||
<DbT as WalletRead>::AccountId: ConditionallySelectable + Default + Send + 'static,
|
<DbT as WalletRead>::AccountId: ConditionallySelectable + Default + Send + 'static,
|
||||||
{
|
{
|
||||||
/// Invokes [`scan_cached_blocks`] with the given arguments, expecting success.
|
/// Invokes [`scan_cached_blocks`] with the given arguments, expecting success.
|
||||||
|
@ -760,6 +761,7 @@ where
|
||||||
AccountIdT: std::cmp::Eq + std::hash::Hash,
|
AccountIdT: std::cmp::Eq + std::hash::Hash,
|
||||||
ErrT: std::fmt::Debug,
|
ErrT: std::fmt::Debug,
|
||||||
DbT: InputSource<AccountId = AccountIdT, Error = ErrT>
|
DbT: InputSource<AccountId = AccountIdT, Error = ErrT>
|
||||||
|
+ WalletTest
|
||||||
+ WalletWrite<AccountId = AccountIdT, Error = ErrT>
|
+ WalletWrite<AccountId = AccountIdT, Error = ErrT>
|
||||||
+ WalletCommitmentTrees,
|
+ WalletCommitmentTrees,
|
||||||
<DbT as WalletRead>::AccountId: ConditionallySelectable + Default + Send + 'static,
|
<DbT as WalletRead>::AccountId: ConditionallySelectable + Default + Send + 'static,
|
||||||
|
@ -1069,7 +1071,19 @@ where
|
||||||
pub fn get_wallet_summary(&self, min_confirmations: u32) -> Option<WalletSummary<AccountIdT>> {
|
pub fn get_wallet_summary(&self, min_confirmations: u32) -> Option<WalletSummary<AccountIdT>> {
|
||||||
self.wallet().get_wallet_summary(min_confirmations).unwrap()
|
self.wallet().get_wallet_summary(min_confirmations).unwrap()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<Cache, DbT, ParamsT, AccountIdT, ErrT> TestState<Cache, DbT, ParamsT>
|
||||||
|
where
|
||||||
|
ParamsT: consensus::Parameters + Send + 'static,
|
||||||
|
AccountIdT: std::cmp::Eq + std::hash::Hash,
|
||||||
|
ErrT: std::fmt::Debug,
|
||||||
|
DbT: InputSource<AccountId = AccountIdT, Error = ErrT>
|
||||||
|
+ WalletTest
|
||||||
|
+ WalletWrite<AccountId = AccountIdT, Error = ErrT>
|
||||||
|
+ WalletCommitmentTrees,
|
||||||
|
<DbT as WalletRead>::AccountId: ConditionallySelectable + Default + Send + 'static,
|
||||||
|
{
|
||||||
/// Returns a transaction from the history.
|
/// Returns a transaction from the history.
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn get_tx_from_history(
|
pub fn get_tx_from_history(
|
||||||
|
@ -1149,6 +1163,7 @@ pub trait DataStoreFactory {
|
||||||
type DsError: core::fmt::Debug;
|
type DsError: core::fmt::Debug;
|
||||||
type DataStore: InputSource<AccountId = Self::AccountId, Error = Self::DsError>
|
type DataStore: InputSource<AccountId = Self::AccountId, Error = Self::DsError>
|
||||||
+ WalletRead<AccountId = Self::AccountId, Account = Self::Account, Error = Self::DsError>
|
+ WalletRead<AccountId = Self::AccountId, Account = Self::Account, Error = Self::DsError>
|
||||||
|
+ WalletTest
|
||||||
+ WalletWrite
|
+ WalletWrite
|
||||||
+ WalletCommitmentTrees;
|
+ WalletCommitmentTrees;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ use crate::{
|
||||||
data_api::{
|
data_api::{
|
||||||
chain::{CommitmentTreeRoot, ScanSummary},
|
chain::{CommitmentTreeRoot, ScanSummary},
|
||||||
testing::{pool::ShieldedPoolTester, TestState},
|
testing::{pool::ShieldedPoolTester, TestState},
|
||||||
DecryptedTransaction, InputSource, WalletCommitmentTrees, WalletRead, WalletSummary,
|
DecryptedTransaction, InputSource, WalletCommitmentTrees, WalletSummary, WalletTest,
|
||||||
},
|
},
|
||||||
wallet::{Note, ReceivedNote},
|
wallet::{Note, ReceivedNote},
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,7 @@ impl ShieldedPoolTester for OrchardPoolTester {
|
||||||
type MerkleTreeHash = MerkleHashOrchard;
|
type MerkleTreeHash = MerkleHashOrchard;
|
||||||
type Note = orchard::note::Note;
|
type Note = orchard::note::Note;
|
||||||
|
|
||||||
fn test_account_fvk<Cache, DbT: WalletRead, P: consensus::Parameters>(
|
fn test_account_fvk<Cache, DbT: WalletTest, P: consensus::Parameters>(
|
||||||
st: &TestState<Cache, DbT, P>,
|
st: &TestState<Cache, DbT, P>,
|
||||||
) -> Self::Fvk {
|
) -> Self::Fvk {
|
||||||
st.test_account_orchard().unwrap().clone()
|
st.test_account_orchard().unwrap().clone()
|
||||||
|
@ -90,7 +90,7 @@ impl ShieldedPoolTester for OrchardPoolTester {
|
||||||
MerkleHashOrchard::empty_root(level)
|
MerkleHashOrchard::empty_root(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn put_subtree_roots<Cache, DbT: WalletRead + WalletCommitmentTrees, P>(
|
fn put_subtree_roots<Cache, DbT: WalletTest + WalletCommitmentTrees, P>(
|
||||||
st: &mut TestState<Cache, DbT, P>,
|
st: &mut TestState<Cache, DbT, P>,
|
||||||
start_index: u64,
|
start_index: u64,
|
||||||
roots: &[CommitmentTreeRoot<Self::MerkleTreeHash>],
|
roots: &[CommitmentTreeRoot<Self::MerkleTreeHash>],
|
||||||
|
@ -103,7 +103,7 @@ impl ShieldedPoolTester for OrchardPoolTester {
|
||||||
s.next_orchard_subtree_index()
|
s.next_orchard_subtree_index()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn select_spendable_notes<Cache, DbT: InputSource + WalletRead, P>(
|
fn select_spendable_notes<Cache, DbT: InputSource + WalletTest, P>(
|
||||||
st: &TestState<Cache, DbT, P>,
|
st: &TestState<Cache, DbT, P>,
|
||||||
account: <DbT as InputSource>::AccountId,
|
account: <DbT as InputSource>::AccountId,
|
||||||
target_value: Zatoshis,
|
target_value: Zatoshis,
|
||||||
|
|
|
@ -23,7 +23,7 @@ use crate::{
|
||||||
testing::{AddressType, TestBuilder},
|
testing::{AddressType, TestBuilder},
|
||||||
wallet::{decrypt_and_store_transaction, input_selection::GreedyInputSelector},
|
wallet::{decrypt_and_store_transaction, input_selection::GreedyInputSelector},
|
||||||
Account as _, DecryptedTransaction, InputSource, WalletCommitmentTrees, WalletRead,
|
Account as _, DecryptedTransaction, InputSource, WalletCommitmentTrees, WalletRead,
|
||||||
WalletSummary,
|
WalletSummary, WalletTest,
|
||||||
},
|
},
|
||||||
decrypt_transaction,
|
decrypt_transaction,
|
||||||
fees::{standard, DustOutputPolicy},
|
fees::{standard, DustOutputPolicy},
|
||||||
|
@ -42,7 +42,7 @@ pub trait ShieldedPoolTester {
|
||||||
type MerkleTreeHash;
|
type MerkleTreeHash;
|
||||||
type Note;
|
type Note;
|
||||||
|
|
||||||
fn test_account_fvk<Cache, DbT: WalletRead, P: consensus::Parameters>(
|
fn test_account_fvk<Cache, DbT: WalletTest, P: consensus::Parameters>(
|
||||||
st: &TestState<Cache, DbT, P>,
|
st: &TestState<Cache, DbT, P>,
|
||||||
) -> Self::Fvk;
|
) -> Self::Fvk;
|
||||||
fn usk_to_sk(usk: &UnifiedSpendingKey) -> &Self::Sk;
|
fn usk_to_sk(usk: &UnifiedSpendingKey) -> &Self::Sk;
|
||||||
|
@ -68,7 +68,7 @@ pub trait ShieldedPoolTester {
|
||||||
fn empty_tree_leaf() -> Self::MerkleTreeHash;
|
fn empty_tree_leaf() -> Self::MerkleTreeHash;
|
||||||
fn empty_tree_root(level: Level) -> Self::MerkleTreeHash;
|
fn empty_tree_root(level: Level) -> Self::MerkleTreeHash;
|
||||||
|
|
||||||
fn put_subtree_roots<Cache, DbT: WalletRead + WalletCommitmentTrees, P>(
|
fn put_subtree_roots<Cache, DbT: WalletTest + WalletCommitmentTrees, P>(
|
||||||
st: &mut TestState<Cache, DbT, P>,
|
st: &mut TestState<Cache, DbT, P>,
|
||||||
start_index: u64,
|
start_index: u64,
|
||||||
roots: &[CommitmentTreeRoot<Self::MerkleTreeHash>],
|
roots: &[CommitmentTreeRoot<Self::MerkleTreeHash>],
|
||||||
|
@ -77,7 +77,7 @@ pub trait ShieldedPoolTester {
|
||||||
fn next_subtree_index<A: Hash + Eq>(s: &WalletSummary<A>) -> u64;
|
fn next_subtree_index<A: Hash + Eq>(s: &WalletSummary<A>) -> u64;
|
||||||
|
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
fn select_spendable_notes<Cache, DbT: InputSource + WalletRead, P>(
|
fn select_spendable_notes<Cache, DbT: InputSource + WalletTest, P>(
|
||||||
st: &TestState<Cache, DbT, P>,
|
st: &TestState<Cache, DbT, P>,
|
||||||
account: <DbT as InputSource>::AccountId,
|
account: <DbT as InputSource>::AccountId,
|
||||||
target_value: Zatoshis,
|
target_value: Zatoshis,
|
||||||
|
|
|
@ -19,7 +19,7 @@ use zip32::Scope;
|
||||||
use crate::{
|
use crate::{
|
||||||
data_api::{
|
data_api::{
|
||||||
chain::{CommitmentTreeRoot, ScanSummary},
|
chain::{CommitmentTreeRoot, ScanSummary},
|
||||||
DecryptedTransaction, InputSource, WalletCommitmentTrees, WalletRead, WalletSummary,
|
DecryptedTransaction, InputSource, WalletCommitmentTrees, WalletSummary, WalletTest,
|
||||||
},
|
},
|
||||||
wallet::{Note, ReceivedNote},
|
wallet::{Note, ReceivedNote},
|
||||||
};
|
};
|
||||||
|
@ -36,7 +36,7 @@ impl ShieldedPoolTester for SaplingPoolTester {
|
||||||
type MerkleTreeHash = sapling::Node;
|
type MerkleTreeHash = sapling::Node;
|
||||||
type Note = sapling::Note;
|
type Note = sapling::Note;
|
||||||
|
|
||||||
fn test_account_fvk<Cache, DbT: WalletRead, P: consensus::Parameters>(
|
fn test_account_fvk<Cache, DbT: WalletTest, P: consensus::Parameters>(
|
||||||
st: &TestState<Cache, DbT, P>,
|
st: &TestState<Cache, DbT, P>,
|
||||||
) -> Self::Fvk {
|
) -> Self::Fvk {
|
||||||
st.test_account_sapling().unwrap().clone()
|
st.test_account_sapling().unwrap().clone()
|
||||||
|
@ -74,7 +74,7 @@ impl ShieldedPoolTester for SaplingPoolTester {
|
||||||
::sapling::Node::empty_root(level)
|
::sapling::Node::empty_root(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn put_subtree_roots<Cache, DbT: WalletRead + WalletCommitmentTrees, P>(
|
fn put_subtree_roots<Cache, DbT: WalletTest + WalletCommitmentTrees, P>(
|
||||||
st: &mut TestState<Cache, DbT, P>,
|
st: &mut TestState<Cache, DbT, P>,
|
||||||
start_index: u64,
|
start_index: u64,
|
||||||
roots: &[CommitmentTreeRoot<Self::MerkleTreeHash>],
|
roots: &[CommitmentTreeRoot<Self::MerkleTreeHash>],
|
||||||
|
@ -87,7 +87,7 @@ impl ShieldedPoolTester for SaplingPoolTester {
|
||||||
s.next_sapling_subtree_index()
|
s.next_sapling_subtree_index()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn select_spendable_notes<Cache, DbT: InputSource + WalletRead, P>(
|
fn select_spendable_notes<Cache, DbT: InputSource + WalletTest, P>(
|
||||||
st: &TestState<Cache, DbT, P>,
|
st: &TestState<Cache, DbT, P>,
|
||||||
account: <DbT as InputSource>::AccountId,
|
account: <DbT as InputSource>::AccountId,
|
||||||
target_value: Zatoshis,
|
target_value: Zatoshis,
|
||||||
|
|
|
@ -53,7 +53,7 @@ use zcash_client_backend::{
|
||||||
Account, AccountBirthday, AccountPurpose, AccountSource, BlockMetadata,
|
Account, AccountBirthday, AccountPurpose, AccountSource, BlockMetadata,
|
||||||
DecryptedTransaction, InputSource, NullifierQuery, ScannedBlock, SeedRelevance,
|
DecryptedTransaction, InputSource, NullifierQuery, ScannedBlock, SeedRelevance,
|
||||||
SentTransaction, SpendableNotes, TransactionDataRequest, WalletCommitmentTrees, WalletRead,
|
SentTransaction, SpendableNotes, TransactionDataRequest, WalletCommitmentTrees, WalletRead,
|
||||||
WalletSummary, WalletWrite, SAPLING_SHARD_HEIGHT,
|
WalletSummary, WalletTest, WalletWrite, SAPLING_SHARD_HEIGHT,
|
||||||
},
|
},
|
||||||
keys::{
|
keys::{
|
||||||
AddressGenerationError, UnifiedAddressRequest, UnifiedFullViewingKey, UnifiedSpendingKey,
|
AddressGenerationError, UnifiedAddressRequest, UnifiedFullViewingKey, UnifiedSpendingKey,
|
||||||
|
@ -614,13 +614,14 @@ impl<C: Borrow<rusqlite::Connection>, P: consensus::Parameters> WalletRead for W
|
||||||
|
|
||||||
Ok(iter.collect())
|
Ok(iter.collect())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(any(test, feature = "test-dependencies"))]
|
#[cfg(any(test, feature = "test-dependencies"))]
|
||||||
|
impl<C: Borrow<rusqlite::Connection>, P: consensus::Parameters> WalletTest for WalletDb<C, P> {
|
||||||
fn get_tx_history(&self) -> Result<Vec<TransactionSummary<Self::AccountId>>, Self::Error> {
|
fn get_tx_history(&self) -> Result<Vec<TransactionSummary<Self::AccountId>>, Self::Error> {
|
||||||
wallet::testing::get_tx_history(self.conn.borrow())
|
wallet::testing::get_tx_history(self.conn.borrow())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(test, feature = "test-dependencies"))]
|
|
||||||
fn get_sent_note_ids(
|
fn get_sent_note_ids(
|
||||||
&self,
|
&self,
|
||||||
txid: &TxId,
|
txid: &TxId,
|
||||||
|
@ -1725,7 +1726,8 @@ mod tests {
|
||||||
use zcash_client_backend::data_api::{
|
use zcash_client_backend::data_api::{
|
||||||
chain::ChainState,
|
chain::ChainState,
|
||||||
testing::{TestBuilder, TestState},
|
testing::{TestBuilder, TestState},
|
||||||
Account, AccountBirthday, AccountPurpose, AccountSource, WalletRead, WalletWrite,
|
Account, AccountBirthday, AccountPurpose, AccountSource, WalletRead, WalletTest,
|
||||||
|
WalletWrite,
|
||||||
};
|
};
|
||||||
use zcash_keys::keys::{UnifiedFullViewingKey, UnifiedSpendingKey};
|
use zcash_keys::keys::{UnifiedFullViewingKey, UnifiedSpendingKey};
|
||||||
use zcash_primitives::block::BlockHash;
|
use zcash_primitives::block::BlockHash;
|
||||||
|
@ -1837,7 +1839,7 @@ mod tests {
|
||||||
AccountSource::Derived { seed_fingerprint: _, account_index } if account_index == zip32_index_2);
|
AccountSource::Derived { seed_fingerprint: _, account_index } if account_index == zip32_index_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_collisions<C, DbT: WalletWrite, P: consensus::Parameters>(
|
fn check_collisions<C, DbT: WalletTest + WalletWrite, P: consensus::Parameters>(
|
||||||
st: &mut TestState<C, DbT, P>,
|
st: &mut TestState<C, DbT, P>,
|
||||||
ufvk: &UnifiedFullViewingKey,
|
ufvk: &UnifiedFullViewingKey,
|
||||||
birthday: &AccountBirthday,
|
birthday: &AccountBirthday,
|
||||||
|
|
|
@ -43,6 +43,7 @@ use {
|
||||||
#[derive(Delegate)]
|
#[derive(Delegate)]
|
||||||
#[delegate(InputSource, target = "wallet_db")]
|
#[delegate(InputSource, target = "wallet_db")]
|
||||||
#[delegate(WalletRead, target = "wallet_db")]
|
#[delegate(WalletRead, target = "wallet_db")]
|
||||||
|
#[delegate(WalletTest, target = "wallet_db")]
|
||||||
#[delegate(WalletWrite, target = "wallet_db")]
|
#[delegate(WalletWrite, target = "wallet_db")]
|
||||||
#[delegate(WalletCommitmentTrees, target = "wallet_db")]
|
#[delegate(WalletCommitmentTrees, target = "wallet_db")]
|
||||||
pub(crate) struct TestDb {
|
pub(crate) struct TestDb {
|
||||||
|
|
|
@ -100,7 +100,7 @@ pub(crate) fn send_multi_step_proposed_transfer<T: ShieldedPoolTester>() {
|
||||||
|
|
||||||
use rand_core::OsRng;
|
use rand_core::OsRng;
|
||||||
use zcash_client_backend::{
|
use zcash_client_backend::{
|
||||||
data_api::{TransactionDataRequest, TransactionStatus},
|
data_api::{TransactionDataRequest, TransactionStatus, WalletTest},
|
||||||
fees::ChangeValue,
|
fees::ChangeValue,
|
||||||
wallet::TransparentAddressMetadata,
|
wallet::TransparentAddressMetadata,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue