zcash_client_backend: Add `MemoryWalletDb::new()`
This commit is contained in:
parent
99260577a4
commit
5ef5f043f5
|
@ -6,7 +6,7 @@ use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
collections::{BTreeMap, HashMap, HashSet},
|
collections::{BTreeMap, HashMap, HashSet},
|
||||||
convert::Infallible,
|
convert::Infallible,
|
||||||
num::NonZeroU32,
|
num::NonZeroU32, hash::Hash,
|
||||||
};
|
};
|
||||||
use zcash_keys::keys::{AddressGenerationError, DerivationError};
|
use zcash_keys::keys::{AddressGenerationError, DerivationError};
|
||||||
use zip32::{fingerprint::SeedFingerprint, DiversifierIndex};
|
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)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
AccountUnknown(u32),
|
AccountUnknown(u32),
|
||||||
|
|
Loading…
Reference in New Issue