]> Untitled Git - bdk/commitdiff
fix(esplora+wallet+file_store): remove remaining `println!` usage
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Thu, 15 Aug 2024 14:52:49 +0000 (11:52 -0300)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Thu, 15 Aug 2024 15:01:31 +0000 (12:01 -0300)
crates/esplora/src/async_ext.rs
crates/esplora/src/blocking_ext.rs
crates/file_store/src/store.rs
crates/wallet/src/wallet/coin_selection.rs

index 066b91e170466496b1c3900286f2f2bb0a77c5fe..c236d4908d9ee71bba4855ebcf34c489c51dbe51 100644 (file)
@@ -490,6 +490,7 @@ mod test {
     #[tokio::test]
     pub async fn test_finalize_chain_update() -> anyhow::Result<()> {
         struct TestCase<'a> {
+            #[allow(dead_code)]
             name: &'a str,
             /// Initial blockchain height to start the env with.
             initial_env_height: u32,
@@ -526,9 +527,7 @@ mod test {
             },
         ];
 
-        for (i, t) in test_cases.into_iter().enumerate() {
-            println!("[{}] running test case: {}", i, t.name);
-
+        for t in test_cases.into_iter() {
             let env = TestEnv::new()?;
             let base_url = format!("http://{}", &env.electrsd.esplora_url.clone().unwrap());
             let client = Builder::new(base_url.as_str()).build_async()?;
@@ -571,7 +570,6 @@ mod test {
                 chain.apply_update(update)?;
                 chain
             };
-            println!("local chain height: {}", local_chain.tip().height());
 
             // extend env chain
             if let Some(to_mine) = t
@@ -611,10 +609,6 @@ mod test {
             // apply update
             let mut updated_local_chain = local_chain.clone();
             updated_local_chain.apply_update(update)?;
-            println!(
-                "updated local chain height: {}",
-                updated_local_chain.tip().height()
-            );
 
             assert!(
                 {
index 6e3e25afe70e613dcc1b4fd337757f339db7c2e0..0806995f1fa49ebc057522ad532bd5b487fc659f 100644 (file)
@@ -490,6 +490,7 @@ mod test {
     #[test]
     pub fn test_finalize_chain_update() -> anyhow::Result<()> {
         struct TestCase<'a> {
+            #[allow(dead_code)]
             name: &'a str,
             /// Initial blockchain height to start the env with.
             initial_env_height: u32,
@@ -526,9 +527,7 @@ mod test {
             },
         ];
 
-        for (i, t) in test_cases.into_iter().enumerate() {
-            println!("[{}] running test case: {}", i, t.name);
-
+        for t in test_cases.into_iter() {
             let env = TestEnv::new()?;
             let base_url = format!("http://{}", &env.electrsd.esplora_url.clone().unwrap());
             let client = Builder::new(base_url.as_str()).build_blocking();
@@ -570,7 +569,6 @@ mod test {
                 chain.apply_update(update)?;
                 chain
             };
-            println!("local chain height: {}", local_chain.tip().height());
 
             // extend env chain
             if let Some(to_mine) = t
@@ -609,10 +607,6 @@ mod test {
             // apply update
             let mut updated_local_chain = local_chain.clone();
             updated_local_chain.apply_update(update)?;
-            println!(
-                "updated local chain height: {}",
-                updated_local_chain.tip().height()
-            );
 
             assert!(
                 {
@@ -773,7 +767,6 @@ mod test {
         ];
 
         for (i, t) in test_cases.into_iter().enumerate() {
-            println!("Case {}: {}", i, t.name);
             let mut chain = t.chain;
 
             let mock_anchors = t
index d1bd3c40c66200a09a13a61900df9530e88f1452..62c3d91b666d0d92d73ae59f498cfc0dd09d1c9e 100644 (file)
@@ -340,7 +340,6 @@ mod test {
 
         for short_write_len in 1..last_changeset_bytes.len() - 1 {
             let file_path = temp_dir.path().join(format!("{}.dat", short_write_len));
-            println!("Test file: {:?}", file_path);
 
             // simulate creating a file, writing data where the last write is incomplete
             {
@@ -406,7 +405,6 @@ mod test {
 
         for read_count in 0..changesets.len() {
             let file_path = temp_dir.path().join(format!("{}.dat", read_count));
-            println!("Test file: {:?}", file_path);
 
             // First, we create the file with all the changesets!
             let mut db = Store::<TestChangeSet>::create_new(&TEST_MAGIC_BYTES, &file_path).unwrap();
index 4cd900378891fac66985b74cdf1936222b66336d..8dc36b198b230135cfc96b12d0469ccedc488285 100644 (file)
@@ -1579,7 +1579,6 @@ mod test {
         ];
 
         for (i, t) in test_cases.into_iter().enumerate() {
-            println!("Case {}: {}", i, t.name);
             let (required, optional) =
                 filter_duplicates(to_utxo_vec(t.required), to_utxo_vec(t.optional));
             assert_eq!(