Просмотр исходного кода

remove money harness, and rename dao_harness to just harness

x 3 лет назад
Родитель
Сommit
1b096e8f3f

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

@@ -50,6 +50,23 @@ use darkfi_dao_contract::{
     DAO_CONTRACT_ZKAS_DAO_VOTE_BURN_NS, DAO_CONTRACT_ZKAS_DAO_VOTE_MAIN_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!(target: "dao", "Logger already initialized");
+    }
+
+    Ok(())
+}
+
 pub struct DaoTestHarness {
     /// Minting all new coins
     pub faucet_kp: Keypair,

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

@@ -49,11 +49,8 @@ use darkfi_money_contract::{
     MoneyFunction,
 };
 
-mod dao_harness;
-use dao_harness::DaoTestHarness;
-
-mod money_harness;
-use money_harness::{init_logger, MoneyTestHarness};
+mod harness;
+use harness::{init_logger, DaoTestHarness};
 
 // TODO: Anonymity leaks in this proof of concept:
 //

+ 0 - 1
src/contract/dao/tests/money_harness.rs

@@ -1 +0,0 @@
-../../money/tests/harness.rs