Skip to content

Commit

Permalink
fix(esplora+wallet+file_store): remove remaining println! usage
Browse files Browse the repository at this point in the history
  • Loading branch information
oleonardolima committed Aug 15, 2024
1 parent b32b944 commit e063ad8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
10 changes: 2 additions & 8 deletions crates/esplora/src/async_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()?;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!(
{
Expand Down
11 changes: 2 additions & 9 deletions crates/esplora/src/blocking_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!(
{
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions crates/file_store/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion crates/wallet/src/wallet/coin_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit e063ad8

Please sign in to comment.