mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
wallet: Fix test units.
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user