pub async fn snapshot(storage: &mut Connection<'_, Core>) -> Snapshot {
    let l1_batch = storage
        .blocks_dal()
        .get_sealed_l1_batch_number()
        .await
        .unwrap()
        .expect("no L1 batches in storage");
    let l1_batch = storage
        .blocks_dal()
        .get_l1_batch_header(l1_batch)
        .await
        .unwrap()
        .unwrap();
    let (_, l2_block) = storage
        .blocks_dal()
        .get_l2_block_range_of_l1_batch(l1_batch.number)
        .await
        .unwrap()
        .unwrap();
    let all_hashes = H256::zero()..=H256::repeat_byte(0xff);
    Snapshot {
        l2_block: storage
            .blocks_dal()
            .get_l2_block_header(l2_block)
            .await
            .unwrap()
            .unwrap(),
        storage_logs: storage
            .snapshots_creator_dal()
            .get_storage_logs_chunk(l2_block, l1_batch.number, all_hashes)
            .await
            .unwrap(),
        factory_deps: storage
            .snapshots_creator_dal()
            .get_all_factory_deps(l2_block)
            .await
            .unwrap()
            .into_iter()
            .collect(),
        l1_batch,
    }
}
Takes a storage snapshot at the last sealed L1 batch.
core/node/test_utils/src/lib.rs