Skip to content

Commit f652e62

Browse files
Fix
1 parent 1b6a81d commit f652e62

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

rust/cardano-chain-follower/examples/follow_chains.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const RUNNING_UPDATE_INTERVAL: u64 = 100_000;
244244
/// Try and follow a chain continuously, from Genesis until Tip.
245245
#[allow(clippy::too_many_lines)]
246246
async fn follow_for(
247-
network: &Network,
247+
network: Network,
248248
matches: ArgMatches,
249249
) {
250250
info!(chain = network.to_string(), "Following");
@@ -290,7 +290,7 @@ async fn follow_for(
290290
let mut largest_aux_size: usize = 0;
291291
let mut found_transactions: usize = 0;
292292

293-
let mut follower = ChainFollower::new(network, origin, Point::TIP).await;
293+
let mut follower = ChainFollower::new(&network, origin, Point::TIP).await;
294294

295295
while let Some(chain_update) = follower.next().await {
296296
updates = updates.saturating_add(1);
@@ -382,7 +382,7 @@ async fn follow_for(
382382
if largest_metadata {
383383
update_largest_metadata(
384384
block,
385-
network,
385+
&network,
386386
txn_idx.into(),
387387
&mut largest_metadata_size,
388388
);
@@ -391,29 +391,29 @@ async fn follow_for(
391391
let this_hash = format!("{}", tx.hash());
392392
if check_txn_hashes(&this_hash, dump_txn_hash) {
393393
found_transactions = found_transactions.saturating_add(1);
394-
log_transaction(network, block, txn_idx.into(), tx, &this_hash);
394+
log_transaction(&network, block, txn_idx.into(), tx, &this_hash);
395395
}
396396
}
397397
}
398398
}
399399
// Update and log the largest transaction auxiliary data.
400400
if largest_aux {
401-
update_largest_aux(decoded_block, network, &mut largest_aux_size);
401+
update_largest_aux(decoded_block, &network, &mut largest_aux_size);
402402
}
403403

404404
// Log the raw auxiliary data.
405405
if log_raw_aux {
406-
raw_aux_info(decoded_block, network);
406+
raw_aux_info(decoded_block, &network);
407407
}
408408

409409
// Illustrate how the chain-follower works with metadata.
410410
// Log bad CIP36.
411411
if log_bad_cip36 {
412-
log_bad_cip36_info(block, network);
412+
log_bad_cip36_info(block, &network);
413413
}
414414
// Log bad CIP509.
415415
if log_bad_cip509 {
416-
log_bad_cip509_info(block, network);
416+
log_bad_cip509_info(block, &network);
417417
}
418418

419419
prev_hash = Some(decoded_block.hash());
@@ -433,7 +433,7 @@ async fn follow_for(
433433
if check_time.duration_since(last_metrics_time).as_secs() >= 60 {
434434
last_metrics_time = check_time;
435435

436-
let stats = Statistics::new(network);
436+
let stats = Statistics::new(&network);
437437

438438
if !inhibit_stats {
439439
info!("Json Metrics: {}", stats.as_json(true));
@@ -461,7 +461,7 @@ async fn follow_for(
461461
}
462462

463463
if !inhibit_stats {
464-
let stats = Statistics::new(network);
464+
let stats = Statistics::new(&network);
465465
info!("Json Metrics: {}", stats.as_json(true));
466466
}
467467

@@ -734,7 +734,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
734734
// Make a follower for the network.
735735
let mut tasks = Vec::new();
736736
for network in &networks {
737-
tasks.push(tokio::spawn(follow_for(network, matches.clone())));
737+
tasks.push(tokio::spawn(follow_for(network.clone(), matches.clone())));
738738
}
739739

740740
// Wait for all followers to finish.

0 commit comments

Comments
 (0)