/// Completes the in-progress block and returns a summary of the batches in the block
///
/// Any batches that were scheduled but have not yet been executed will be descheduled.
///
/// # Errors
///
/// * Returns a `BlockNotInitialized` error if there is no in-progress block
/// * Returns a `BlockEmpty` error if there are no valid, non-injected batches in the block. In
///   this case, the block is not completed and any unexecuted batches are added back to the
///   scheduler; the caller will need to wait for these batches to be executed or new batches
///   to submitted and executed before they can successfully summarize the block.
Completes the in-progress block and returns a summary of the batches in the block
Any batches that were scheduled but have not yet been executed will be descheduled.
Completes the in - progress block and returns a summary of the batches in the block Any batches that were scheduled but have not yet been executed will be descheduled .
pub fn summarize_block(&self) -> Result<Vec<u8>, BlockPublisherError> {
        let mut candidate_block = self
            .candidate_block
            .lock()
            .map_err(|_| BlockPublisherError::Internal("Candidate block lock poisoned".into()))?;
        if let Some(mut candidate_block) = candidate_block.as_mut() {
            self.complete_candidate_block(&mut candidate_block)?;
            candidate_block.summary.clone().ok_or_else(|| {
                BlockPublisherError::Internal(
                    "Candidate block completed but summary not set".into(),
                )
            })
        } else {
            Err(BlockCompletionError::BlockNotInitialized.into())
        }
    }
pub fn summarize_block ( & self ) -> Result < Vec < u8 > , BlockPublisherError > { let mut candidate_block = self . candidate_block . lock ( ) . map_err ( | _ | BlockPublisherError :: Internal ( " " . into ( ) ) ) ? ; if let Some ( mut candidate_block ) = candidate_block . as_mut ( ) { self . complete_candidate_block ( & mut candidate_block ) ? ; candidate_block . summary . clone ( ) . ok_or_else ( | | { BlockPublisherError :: Internal ( " " . into ( ) , ) } ) } else { Err ( BlockCompletionError :: BlockNotInitialized . into ( ) ) } }
Completes the in-progress block and returns a summary of the batches in the block
Any batches that were scheduled but have not yet been executed will be descheduled.
Completes the in - progress block and returns a summary of the batches in the block Any batches that were scheduled but have not yet been executed will be descheduled .
&self
errors
Returns a `BlockNotInitialized` error if there is no in-progress block
Returns a `BlockEmpty` error if there are no valid, non-injected batches in the block. In
this case, the block is not completed and any unexecuted batches are added back to the
scheduler; the caller will need to wait for these batches to be executed or new batches
to submitted and executed before they can successfully summarize the block.
Returns a ` BlockNotInitialized ` error if there is no in - progress block Returns a ` BlockEmpty ` error if there are no valid non - injected batches in the block . In this case the block is not completed and any unexecuted batches are added back to the scheduler ; the caller will need to wait for these batches to be executed or new batches to submitted and executed before they can successfully summarize the block .