zcash_client_backend: Add `MemoryWalletDb::new()`
This commit is contained in:
parent
99260577a4
commit
5ef5f043f5
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue