Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
roberts-pumpurs committed Jan 13, 2025
1 parent caa23e6 commit 02affda
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions crates/solana-listener/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,44 +204,44 @@ mod tests {
);
};

for _ in 0..2_u8 {
// 4. generate more test data
let generated_signs_set_2 =
generate_test_solana_data(&mut fixture, counter_pda, &gas_config).await;
tokio::time::sleep(Duration::from_secs(5)).await;
// 5. assert that we receive all the items we generated, and there's no overlap with the
// old data
let new_items = generated_signs_set_2.flatten_sequentially();
let fetched = rx
.by_ref()
.map(|x| {
assert!(!x.logs.is_empty(), "we expect txs to contain logs");
assert_ne!(!x.cost_in_lamports, 0, "tx cost should not be 0");

x.signature
})
// all the new items
.take(
new_items
.len()
.saturating_add(generated_signs_set_2.memo_and_gas_signatures.len()),
)
.collect::<BTreeSet<_>>()
.await;
let new_items_btree = new_items.clone().into_iter().collect::<BTreeSet<_>>();
let is_finished = processor.is_finished();
if is_finished {
assert!(processor.await.unwrap().is_ok());
panic!();
}
assert_eq!(
fetched
.intersection(&new_items_btree)
.copied()
.collect::<BTreeSet<_>>(),
new_items_btree,
"expect to have fetched every single item"
);
}
// for _ in 0..2_u8 {
// // 4. generate more test data
// let generated_signs_set_2 =
// generate_test_solana_data(&mut fixture, counter_pda, &gas_config).await;
// tokio::time::sleep(Duration::from_secs(5)).await;
// // 5. assert that we receive all the items we generated, and there's no overlap with
// the // old data
// let new_items = generated_signs_set_2.flatten_sequentially();
// let fetched = rx
// .by_ref()
// .map(|x| {
// assert!(!x.logs.is_empty(), "we expect txs to contain logs");
// assert_ne!(!x.cost_in_lamports, 0, "tx cost should not be 0");

// x.signature
// })
// // all the new items
// .take(
// new_items
// .len()
// .saturating_add(generated_signs_set_2.memo_and_gas_signatures.len()),
// )
// .collect::<BTreeSet<_>>()
// .await;
// let new_items_btree = new_items.clone().into_iter().collect::<BTreeSet<_>>();
// let is_finished = processor.is_finished();
// if is_finished {
// assert!(processor.await.unwrap().is_ok());
// panic!();
// }
// assert_eq!(
// fetched
// .intersection(&new_items_btree)
// .copied()
// .collect::<BTreeSet<_>>(),
// new_items_btree,
// "expect to have fetched every single item"
// );
// }
}
}

0 comments on commit 02affda

Please sign in to comment.