Skip to content

Commit

Permalink
fix: use memdatabase in wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ngutech21 committed Jul 27, 2023
1 parent 2993e7b commit de74cab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions moksha-fedimint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,18 @@ impl FedimintWallet {
) -> anyhow::Result<fedimint_client::Client> {
let mut tg = TaskGroup::new();

// FIXME use memory db
// let db = Self::load_db(workdir).await?;
#[cfg(not(target_arch = "wasm32"))]
let db = Self::load_db(workdir).await?;

#[cfg(target_arch = "wasm32")]
let db = fedimint_core::db::mem_impl::MemDatabase::default();
// FIXME use different db for fedimint in wasm

let mut client_builder = ClientBuilder::default();
client_builder.with_module_gens(module_gens.clone());
client_builder.with_primary_module(1);
client_builder.with_config(cfg.clone());
//client_builder.with_database(db);
client_builder.with_database(db);
client_builder
.build::<PlainRootSecretStrategy>(&mut tg)
.await
Expand Down

0 comments on commit de74cab

Please sign in to comment.