diff --git a/zcash_client_backend/src/data_api/mem_wallet.rs b/zcash_client_backend/src/data_api/mem_wallet.rs index 345237484..52a3e4613 100644 --- a/zcash_client_backend/src/data_api/mem_wallet.rs +++ b/zcash_client_backend/src/data_api/mem_wallet.rs @@ -6,7 +6,7 @@ use std::{ cmp::Ordering, collections::{BTreeMap, HashMap, HashSet}, convert::Infallible, - num::NonZeroU32, + num::NonZeroU32, hash::Hash, }; use zcash_keys::keys::{AddressGenerationError, DerivationError}; use zip32::{fingerprint::SeedFingerprint, DiversifierIndex}; @@ -99,6 +99,24 @@ pub struct MemoryWalletDb { >, } +impl MemoryWalletDb { + pub fn new( + network: Network, + max_checkpoints: usize + ) -> Self { + Self { + network, + accounts: BTreeMap::new(), + blocks: BTreeMap::new(), + tx_idx: HashMap::new(), + sapling_spends: BTreeMap::new(), + orchard_spends: BTreeMap::new(), + sapling_tree: ShardTree::new(MemoryShardStore::empty(), max_checkpoints), + orchard_tree: ShardTree::new(MemoryShardStore::empty(), max_checkpoints), + } + } +} + #[derive(Debug)] pub enum Error { AccountUnknown(u32),