From e0549eb25f71dc160243f5f65dbe74ede5cac712 Mon Sep 17 00:00:00 2001 From: parazyd Date: Sun, 1 May 2022 17:17:52 +0200 Subject: [PATCH] wallet: Fix test units. --- Cargo.toml | 8 ++++---- src/wallet/walletdb.rs | 12 ++++++------ src/zk/circuit/mod.rs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b5f35e83e..be13be863 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -327,7 +327,7 @@ name = "gt" path = "example/gt.rs" required-features = ["node"] -[[example]] -name = "lead" -path = "example/lead.rs" -required-features = ["node"] +#[[example]] +#name = "lead" +#path = "example/lead.rs" +#required-features = ["node"] diff --git a/src/wallet/walletdb.rs b/src/wallet/walletdb.rs index 427cc61eb..995f366ef 100644 --- a/src/wallet/walletdb.rs +++ b/src/wallet/walletdb.rs @@ -467,12 +467,12 @@ mod tests { let wallet = WalletDb::new("sqlite::memory:", WPASS).await?; let keypair = Keypair::random(&mut OsRng); - let tokenlist = DrkTokenList::new(&[ + let tokenlist = Arc::new(DrkTokenList::new(&[ ("drk", include_bytes!("../../contrib/token/darkfi_token_list.min.json")), ("btc", include_bytes!("../../contrib/token/bitcoin_token_list.min.json")), ("eth", include_bytes!("../../contrib/token/erc20_token_list.min.json")), ("sol", include_bytes!("../../contrib/token/solana_token_list.min.json")), - ])?; + ])?); // init_db() wallet.init_db().await?; @@ -491,19 +491,19 @@ mod tests { let c3 = dummy_coin(&keypair.secret, 11, &token_id); // put_own_coin() - wallet.put_own_coin(c0, &tokenlist).await?; + wallet.put_own_coin(c0, tokenlist.clone()).await?; tree1.append(&MerkleNode::from_coin(&c0.coin)); tree1.witness(); - wallet.put_own_coin(c1, &tokenlist).await?; + wallet.put_own_coin(c1, tokenlist.clone()).await?; tree1.append(&MerkleNode::from_coin(&c1.coin)); tree1.witness(); - wallet.put_own_coin(c2, &tokenlist).await?; + wallet.put_own_coin(c2, tokenlist.clone()).await?; tree1.append(&MerkleNode::from_coin(&c2.coin)); tree1.witness(); - wallet.put_own_coin(c3, &tokenlist).await?; + wallet.put_own_coin(c3, tokenlist).await?; tree1.append(&MerkleNode::from_coin(&c3.coin)); tree1.witness(); diff --git a/src/zk/circuit/mod.rs b/src/zk/circuit/mod.rs index cc4b70c7b..f3509b7b8 100644 --- a/src/zk/circuit/mod.rs +++ b/src/zk/circuit/mod.rs @@ -4,5 +4,5 @@ pub use burn_contract::BurnContract; pub mod mint_contract; pub use mint_contract::MintContract; -// pub mod lead_contract; -// pub use lead_contract::LeadContract; +pub mod lead_contract; +pub use lead_contract::LeadContract;