Skip to main content

wait_for_persisted_block

Function wait_for_persisted_block 

Source
pub async fn wait_for_persisted_block<F>(
    factory: &F,
    number: u64,
    timeout: Duration,
) -> Result<()>
Expand description

Waits until the node has persisted at least the given block number to disk.

The engine keeps the most recent blocks in memory, so tests that want to inspect the database, e.g. via assert_trie_consistency, must first advance the chain far enough and wait for the persistence task to catch up. Unlike NodeTestContext::wait_block this only needs the block number and fails after timeout instead of polling indefinitely.