Skip to content

Commit

Permalink
check for new transactions every 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Sep 26, 2024
1 parent 2553165 commit e315895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/demo_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ async fn test_smoke() -> Result<()> {
let mut initial = testing.test_state().await;
println!("Initial State:{}", initial);

let mut i = 1;
loop {
sleep(Duration::from_secs(1)).await;

Expand All @@ -226,7 +227,9 @@ async fn test_smoke() -> Result<()> {
panic!("Chain state not incrementing");
}

if new.txn_count <= initial.txn_count {
// Transactions don't necessarily increment every second. But
// we should definitely see a new after 3 or 4 seconds.
if i % 5 == 0 && new.txn_count <= initial.txn_count {
panic!("Transactions not incrementing");
}

Expand All @@ -249,6 +252,7 @@ async fn test_smoke() -> Result<()> {
break;
}
initial = new;
i = i + 1;
}
Ok(())
}

0 comments on commit e315895

Please sign in to comment.