Skip to content

Commit

Permalink
remove printlns, re-enable deposit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrembal committed Feb 5, 2025
1 parent 1b6d847 commit f5c4bb6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 39 deletions.
50 changes: 24 additions & 26 deletions core/src/rpc/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,6 @@ mod tests {
#[tokio::test]
#[serial_test::serial]
async fn aggregator_setup_and_deposit() {
println!("Starting test");
let config = create_test_config_with_thread_name!(None);

let aggregator = create_actors!(config).2;
Expand All @@ -939,37 +938,36 @@ mod tests {
.unwrap();

tracing::info!("Setting up aggregator");
println!("Setting up aggregator");
let start = std::time::Instant::now();

aggregator_client
.setup(tonic::Request::new(clementine::Empty {}))
.await
.unwrap();

println!("Setup completed in {:?}", start.elapsed());

// tracing::info!("Depositing");
// println!("Depositing");

// aggregator_client
// .new_deposit(DepositParams {
// deposit_outpoint: Some(
// bitcoin::OutPoint {
// txid: Txid::from_str(
// "17e3fc7aae1035e77a91e96d1ba27f91a40a912cf669b367eb32c13a8f82bb02",
// )
// .unwrap(),
// vout: 0,
// }
// .into(),
// ),
// evm_address: [1u8; 20].to_vec(),
// recovery_taproot_address:
// "tb1pk8vus63mx5zwlmmmglq554kwu0zm9uhswqskxg99k66h8m3arguqfrvywa".to_string(),
// user_takes_after: 5,
// })
// .await
// .unwrap();

tracing::info!("Setup completed in {:?}", start.elapsed());
tracing::info!("Depositing");
let deposit_start = std::time::Instant::now();
aggregator_client
.new_deposit(DepositParams {
deposit_outpoint: Some(
bitcoin::OutPoint {
txid: Txid::from_str(
"17e3fc7aae1035e77a91e96d1ba27f91a40a912cf669b367eb32c13a8f82bb02",
)
.unwrap(),
vout: 0,
}
.into(),
),
evm_address: [1u8; 20].to_vec(),
recovery_taproot_address:
"tb1pk8vus63mx5zwlmmmglq554kwu0zm9uhswqskxg99k66h8m3arguqfrvywa".to_string(),
user_takes_after: 5,
})
.await
.unwrap();
tracing::info!("Deposit completed in {:?}", deposit_start.elapsed());
}
}
19 changes: 6 additions & 13 deletions core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ impl BitvmCache {
match borsh::to_vec(self) {
Ok(serialized) => match fs::write(path, serialized) {
Ok(_) => {
println!("Saved BitVM cache to file");
tracing::info!("Saved BitVM cache to file");
true
}
Err(e) => {
println!("Failed to save BitVM cache: {}", e);
tracing::error!("Failed to save BitVM cache: {}", e);
false
}
},
Err(e) => {
println!("Failed to serialize BitVM cache: {}", e);
tracing::error!("Failed to serialize BitVM cache: {}", e);
false
}
}
Expand All @@ -123,24 +123,23 @@ impl BitvmCache {
match fs::read(path) {
Ok(bytes) => match Self::try_from_slice(&bytes) {
Ok(cache) => {
println!("Loaded BitVM cache from file");
tracing::info!("Loaded BitVM cache from file");
Some(cache)
}
Err(e) => {
println!("Failed to deserialize BitVM cache: {}", e);
tracing::error!("Failed to deserialize BitVM cache: {}", e);
None
}
},
Err(_) => {
println!("No BitVM cache found");
tracing::error!("No BitVM cache found");
None
}
}
}
}

fn generate_fresh_data() -> BitvmCache {
println!("Generating fresh BitVM data...");
let intermediate_variables = BridgeAssigner::default().all_intermediate_variables();

let commits_publickeys = intermediate_variables
Expand Down Expand Up @@ -212,11 +211,6 @@ fn generate_fresh_data() -> BitvmCache {
}
}

println!(
"Found {} unique replacement patterns",
replacement_places.len()
);

BitvmCache {
intermediate_variables,
disprove_scripts: scripts,
Expand Down Expand Up @@ -257,7 +251,6 @@ pub fn replace_disprove_scripts(winternitz_pk: &[Vec<[u8; 20]>]) -> Vec<ScriptBu

let elapsed = start.elapsed();
tracing::info!("Script replacement completed in {:?}", elapsed);
println!("Script replacement completed in {:?}", elapsed);

result
}
Expand Down

0 comments on commit f5c4bb6

Please sign in to comment.