pub async fn new(
        connection_pool: &ConnectionPool<Core>,
        alice: &mut Account,
        transaction_count: u32,
        transactions: &[Transaction],
    ) -> Self {
        let mut tester = Tester::new(connection_pool.clone(), FastVmMode::Old);
        tester.genesis().await;
        tester.fund(&[alice.address()]).await;

        let mut storage = connection_pool.connection().await.unwrap();
        let all_logs = storage
            .snapshots_creator_dal()
            .get_storage_logs_chunk(
                L2BlockNumber(0),
                L1BatchNumber(0),
                H256::zero()..=H256::repeat_byte(0xff),
            )
            .await
            .unwrap();
        let factory_deps = storage
            .snapshots_creator_dal()
            .get_all_factory_deps(L2BlockNumber(0))
            .await
            .unwrap();
        let mut all_logs: HashMap<_, _> = all_logs
            .into_iter()
            .map(|log| (log.key, log.value))
            .collect();
        drop(storage);

        let mut executor = tester
            .create_batch_executor(StorageType::AsyncRocksdbCache)
            .await;
        let mut l2_block_env = L2BlockEnv {
            number: 1,
            prev_block_hash: L2BlockHasher::legacy_hash(L2BlockNumber(0)),
            timestamp: 100,
            max_virtual_blocks_to_create: 1,
        };
        let mut storage_writes_deduplicator = StorageWritesDeduplicator::new();

        for transaction in transactions {
            let tx_hash = transaction.hash(); // probably incorrect
            let res = executor.execute_tx(transaction.clone()).await.unwrap();
            if !res.tx_result.result.is_failed() {
                let storage_logs = &res.tx_result.logs.storage_logs;
                storage_writes_deduplicator
                    .apply(storage_logs.iter().filter(|log| log.log.is_write()));
            } else {
                panic!("Unexpected tx execution result: {res:?}");
            };

            let mut hasher = L2BlockHasher::new(
                L2BlockNumber(l2_block_env.number),
                l2_block_env.timestamp,
                l2_block_env.prev_block_hash,
            );
            hasher.push_tx_hash(tx_hash);

            l2_block_env.number += 1;
            l2_block_env.timestamp += 1;
            l2_block_env.prev_block_hash = hasher.finalize(ProtocolVersionId::latest());
            executor.start_next_l2_block(l2_block_env).await.unwrap();
        }

        for _ in 0..transaction_count {
            let tx = alice.execute();
            let tx_hash = tx.hash(); // probably incorrect
            let res = executor.execute_tx(tx).await.unwrap();
            assert!(!res.was_halted());
            let tx_result = res.tx_result;
            let storage_logs = &tx_result.logs.storage_logs;
            storage_writes_deduplicator.apply(storage_logs.iter().filter(|log| log.log.is_write()));

            let mut hasher = L2BlockHasher::new(
                L2BlockNumber(l2_block_env.number),
                l2_block_env.timestamp,
                l2_block_env.prev_block_hash,
            );
            hasher.push_tx_hash(tx_hash);

            l2_block_env.number += 1;
            l2_block_env.timestamp += 1;
            l2_block_env.prev_block_hash = hasher.finalize(ProtocolVersionId::latest());
            executor.start_next_l2_block(l2_block_env).await.unwrap();
        }

        let (finished_batch, _) = executor.finish_batch().await.unwrap();
        let storage_logs = &finished_batch.block_tip_execution_result.logs.storage_logs;
        storage_writes_deduplicator.apply(storage_logs.iter().filter(|log| log.log.is_write()));
        let modified_entries = storage_writes_deduplicator.into_modified_key_values();
        all_logs.extend(
            modified_entries
                .into_iter()
                .map(|(key, slot)| (key.hashed_key(), slot.value)),
        );

        // Compute the hash of the last (fictive) L2 block in the batch.
        let l2_block_hash = L2BlockHasher::new(
            L2BlockNumber(l2_block_env.number),
            l2_block_env.timestamp,
            l2_block_env.prev_block_hash,
        )
        .finalize(ProtocolVersionId::latest());

        let mut storage = connection_pool.connection().await.unwrap();
        storage.blocks_dal().delete_genesis().await.unwrap();
        Self {
            l2_block_number: L2BlockNumber(l2_block_env.number),
            l2_block_timestamp: l2_block_env.timestamp,
            l2_block_hash,
            storage_logs: all_logs,
            factory_deps: factory_deps.into_iter().collect(),
        }
    }
Generates a new snapshot by executing the specified number of transactions, each in a separate L2 block.
core/node/state_keeper/src/executor/tests/tester.rs