parazyd 4 лет назад
Родитель
Сommit
e0549eb25f
3 измененных файлов с 12 добавлено и 12 удалено
  1. 4 4
      Cargo.toml
  2. 6 6
      src/wallet/walletdb.rs
  3. 2 2
      src/zk/circuit/mod.rs

+ 4 - 4
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"]

+ 6 - 6
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();
 

+ 2 - 2
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;