x пре 3 година
родитељ
комит
25b4bc2a42
2 измењених фајлова са 13 додато и 19 уклоњено
  1. 0 17
      src/contract/dao/tests/dao_harness.rs
  2. 13 2
      src/contract/dao/tests/integration.rs

+ 0 - 17
src/contract/dao/tests/harness.rs → src/contract/dao/tests/dao_harness.rs

@@ -43,23 +43,6 @@ use rand::rngs::OsRng;
 
 use darkfi_dao_contract::DAO_CONTRACT_ZKAS_DAO_MINT_NS;
 
-pub fn init_logger() -> Result<()> {
-    let mut cfg = simplelog::ConfigBuilder::new();
-    cfg.add_filter_ignore("sled".to_string());
-    if let Err(_) = simplelog::TermLogger::init(
-        //simplelog::LevelFilter::Info,
-        simplelog::LevelFilter::Debug,
-        //simplelog::LevelFilter::Trace,
-        cfg.build(),
-        simplelog::TerminalMode::Mixed,
-        simplelog::ColorChoice::Auto,
-    ) {
-        warn!("Logger already initialized");
-    }
-
-    Ok(())
-}
-
 pub struct DaoTestHarness {
     pub alice_kp: Keypair,
     pub dao_kp: Keypair,

+ 13 - 2
src/contract/dao/tests/integration.rs

@@ -32,8 +32,17 @@ use darkfi_dao_contract::{
     DaoFunction,
 };
 
-mod harness;
-use harness::{init_logger, DaoTestHarness};
+use darkfi_money_contract::{
+    client::{build_half_swap_tx, build_transfer_tx, Coin, EncryptedNote, OwnCoin},
+    state::MoneyTransferParams,
+    MoneyFunction,
+};
+
+mod dao_harness;
+use dao_harness::DaoTestHarness;
+
+mod money_harness;
+use money_harness::{init_logger, MoneyTestHarness};
 
 // TODO: Anonymity leaks in this proof of concept:
 //
@@ -122,5 +131,7 @@ async fn integration_test() -> Result<()> {
     // =======================================================
     debug!(target: "demo", "Stage 2. Minting treasury token");
 
+    let mut th = MoneyTestHarness::new().await?;
+
     Ok(())
 }