diff --git a/justfile b/justfile index 85b5bfd..80c74db 100644 --- a/justfile +++ b/justfile @@ -14,6 +14,10 @@ test-message-board-web: test-simple-web: WASM_BINDGEN_TEST_TIMEOUT=99999 wasm-pack test --release --firefox --no-default-features --features="wasm" -Z build-std="panic_abort,std" --test simple-sync-and-send +test-batchrunner-web: + WASM_BINDGEN_TEST_TIMEOUT=99999 wasm-pack test --release --firefox --no-default-features --features="wasm" -Z build-std="panic_abort,std" --test batchrunner + + ## Native Examples example-simple: diff --git a/tests/batchrunner.rs b/tests/batchrunner.rs index 415612a..550acdd 100644 --- a/tests/batchrunner.rs +++ b/tests/batchrunner.rs @@ -21,7 +21,7 @@ pub fn initialize() { } #[wasm_bindgen_test] -async fn test_get_and_scan_range() { +async fn batchrunner() { initialize(); let mut w = WebWallet::new("test", "https://zcash-testnet.chainsafe.dev", 1).unwrap(); diff --git a/tests/message-board-sync.rs b/tests/message-board-sync.rs index 41ffac2..cc98509 100644 --- a/tests/message-board-sync.rs +++ b/tests/message-board-sync.rs @@ -2,6 +2,8 @@ use wasm_bindgen_test::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); use std::sync::Once; +use zcash_client_backend::sync::run; +use zcash_client_memory::MemBlockCache; use webz_core::bindgen::wallet::WebWallet; use zcash_keys::keys::UnifiedFullViewingKey; use zcash_primitives::consensus::Network; @@ -33,14 +35,27 @@ async fn test_message_board() { let id = w.import_ufvk(&ufvk_str, Some(2477329)).await.unwrap(); tracing::info!("Created account with id: {}", id); - tracing::info!("Syncing wallet"); - w.sync(&js_sys::Function::new_with_args( - "scanned_to, tip", - "console.log('Scanned: ', scanned_to, '/', tip)", - )) + // tracing::info!("Syncing wallet"); + // w.sync(&js_sys::Function::new_with_args( + // "scanned_to, tip", + // "console.log('Scanned: ', scanned_to, '/', tip)", + // )) + // .await + // .unwrap(); + // tracing::info!("Syncing complete :)"); + + let db_cache = MemBlockCache::new(); + let mut cpt_client = w.client().clone(); + + run( + &mut cpt_client, + &Network::TestNetwork, + &db_cache, + w.inner_mut().inner_mut(), + 10000, + ) .await .unwrap(); - tracing::info!("Syncing complete :)"); let summary = w.get_wallet_summary().unwrap(); tracing::info!("Wallet summary: {:?}", summary);