Skip to content

Commit

Permalink
Wait until EVM processes block
Browse files Browse the repository at this point in the history
  • Loading branch information
rakanalh committed Jul 13, 2024
1 parent 9b04f79 commit 6c19435
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/citrea/tests/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,10 @@ async fn test_prover_sync_with_commitments() -> Result<(), anyhow::Error> {
// a new MockDa block, which in turn causes the sequencer to publish an extra soft confirmation
// becase it must not skip blocks.
wait_for_l2_block(&prover_node_test_client, 8, None).await;
// Allow for the L2 block to be commited and stored
// Otherwise, the L2 block height might be registered but it hasn't
// been processed inside the EVM yet.
sleep(Duration::from_secs(1)).await;
assert_eq!(prover_node_test_client.eth_block_number().await, 8);
// on the 8th DA block, we should have a proof
let mut blobs = da_service.get_block_at(4).await.unwrap().blobs;
Expand Down Expand Up @@ -1510,6 +1514,10 @@ async fn test_reopen_prover() -> Result<(), anyhow::Error> {
wait_for_l2_block(&seq_test_client, 6, None).await;
// Still should have 4 blocks there are no commitments yet
wait_for_l2_block(&prover_node_test_client, 6, None).await;
// Allow for the L2 block to be commited and stored
// Otherwise, the L2 block height might be registered but it hasn't
// been processed inside the EVM yet.
sleep(Duration::from_secs(1)).await;
assert_eq!(prover_node_test_client.eth_block_number().await, 6);

thread_kill_sender.send("kill").unwrap();
Expand Down

0 comments on commit 6c19435

Please sign in to comment.