fix(wallet): remove generic from wallet

This commit is contained in:
Rob N
2024-04-13 10:21:24 -10:00
parent ee21ffeee0
commit e51af49ffa
10 changed files with 157 additions and 234 deletions

View File

@@ -31,7 +31,6 @@ pub type KeychainChangeSet<A> = (
local_chain::ChangeSet,
indexed_tx_graph::ChangeSet<A, keychain::ChangeSet<Keychain>>,
);
pub type Database<C> = Persist<Store<C>, C>;
#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
@@ -440,7 +439,7 @@ pub fn planned_utxos<A: Anchor, O: ChainOracle, K: Clone + bdk_tmp_plan::CanDeri
pub fn handle_commands<CS: clap::Subcommand, S: clap::Args, A: Anchor, O: ChainOracle, C>(
graph: &Mutex<KeychainTxGraph<A>>,
db: &Mutex<Database<C>>,
db: &Mutex<Persist<C>>,
chain: &Mutex<O>,
keymap: &BTreeMap<DescriptorPublicKey, DescriptorSecretKey>,
network: Network,
@@ -667,7 +666,7 @@ pub struct Init<CS: clap::Subcommand, S: clap::Args, C> {
/// Keychain-txout index.
pub index: KeychainTxOutIndex<Keychain>,
/// Persistence backend.
pub db: Mutex<Database<C>>,
pub db: Mutex<Persist<C>>,
/// Initial changeset.
pub init_changeset: C,
}
@@ -679,7 +678,13 @@ pub fn init<CS: clap::Subcommand, S: clap::Args, C>(
db_default_path: &str,
) -> anyhow::Result<Init<CS, S, C>>
where
C: Default + Append + Serialize + DeserializeOwned,
C: Default
+ Append
+ Serialize
+ DeserializeOwned
+ core::marker::Send
+ core::marker::Sync
+ 'static,
{
if std::env::var("BDK_DB_PATH").is_err() {
std::env::set_var("BDK_DB_PATH", db_default_path);
@@ -715,7 +720,7 @@ where
args,
keymap,
index,
db: Mutex::new(Database::new(db_backend)),
db: Mutex::new(Persist::new(db_backend)),
init_changeset,
})
}