pub async fn wait_for_blocks_and_verify_certs(
        &self,
        ctx: &ctx::Ctx,
        want_last: validator::BlockNumber,
    ) -> ctx::Result<Vec<validator::Block>> {
        let blocks = self.wait_for_blocks(ctx, want_last).await?;
        let cfg = self
            .connection(ctx)
            .await
            .wrap("connection()")?
            .global_config(ctx)
            .await
            .wrap("genesis()")?
            .context("genesis is missing")?;
        for block in &blocks {
            match block {
                validator::Block::FinalV1(block) => {
                    block
                        .verify(
                            cfg.genesis.hash(),
                            &cfg.genesis.validators_schedule.clone().unwrap(),
                        )
                        .context(block.number())?;
                }
                validator::Block::FinalV2(block) => {
                    // Here we are assuming that we are using a static validators schedule. Hence
                    // getting the epoch number from the genesis config and using epoch 0.
                    block
                        .verify(
                            cfg.genesis.hash(),
                            validator::EpochNumber(0),
                            &cfg.genesis.validators_schedule.clone().unwrap(),
                        )
                        .context(block.number())?;
                }
                validator::Block::PreGenesis(_) => {}
            }
        }
        Ok(blocks)
    }
Same as `wait_for_blocks`, but additionally verifies all certificates.
core/node/consensus/src/storage/testonly.rs