Skip to content

Conversation

@greged93
Copy link
Contributor

@greged93 greged93 commented Nov 3, 2025

PR for the update of the test setup. Provides a set of high level abstractions that allow testers to easily set up initial tests conditions, run the test and directly expect test outcome.

Below are some examples of the usage of the framework:

    // Start a sequencer node with a follower node and configure the sequencer.
    let mut fixture = TestFixture::builder()
     .sequencer()
     .followers(1)
     .auto_start(true)
     .allow_empty_blocks(false)
     .build()
     .await?;

    // Set the l1 to synced and expect an Optimistic Sync event.
    fixture.l1().sync().await?;
    fixture.expect_event().optimistic_sync().await?;
   
    // Inject a transfer to the sequencer and build a block, expecting block number 10, containing the injected transaction.
    let hash = fixture.inject_transfer().await?;
    fixture.build_block().expect_block_number(10).expect_tx(hash).await_block().await?;

    // For node 0 (sequencer node), add a L1 message with L1 block number 10, a sender, value 0, and destination 0.
    fixture
        .l1()
        .for_node(0)
        .add_message()
        .at_block(10)
        .sender(address!("f39Fd6e51aad88F6F4ce6aB8827279cffFb92266"))
        .value(0)
        .to(Address::ZERO)
        .send()
        .await?;

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 3, 2025

CodSpeed Performance Report

Merging #407 will not alter performance

Comparing tests/improve-framework (c3aaaee) with main (05870a0)

Summary

✅ 2 untouched

Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments inline.

@frisitano frisitano merged commit b6cfa91 into main Nov 18, 2025
15 checks passed
@frisitano frisitano deleted the tests/improve-framework branch November 18, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants