pub async fn check_valid_if_saf(
    header: &Header,
    workspace: &SysValidationWorkspace,
) -> SysValidationResult<()> {
    match header {
        Header::Saf(_) => {
            if workspace.is_chain_empty(header.author())? {
                Ok(())
            } else {
                Err(PrevHeaderError::InvalidRoot).map_err(|e| ValidationOutcome::from(e).into())
            }
        }
        _ => Ok(()),
    }
}
/// Check that Saf headers are only added to empty source chains
Check that Saf headers are only added to empty source chains
Check that Saf headers are only added to empty source chains
pub async fn check_valid_if_saf(
    header: &Header,
    workspace: &SysValidationWorkspace,
) -> SysValidationResult<()> {
    match header {
        Header::Saf(_) => {
            if workspace.is_chain_empty(header.author())? {
                Ok(())
            } else {
                Err(PrevHeaderError::InvalidRoot).map_err(|e| ValidationOutcome::from(e).into())
            }
        }
        _ => Ok(()),
    }
}
pub async fn check_valid_if_saf ( header : & Header , workspace : & SysValidationWorkspace , ) -> SysValidationResult < ( ) > { match header { Header :: Saf ( _ ) => { if workspace . is_chain_empty ( header . author ( ) ) ? { Ok ( ( ) ) } else { Err ( PrevHeaderError :: InvalidRoot ) . map_err ( | e | ValidationOutcome :: from ( e ) . into ( ) ) } } _ => Ok ( ( ) ) , } }
Check that Saf headers are only added to empty source chains
Check that Saf headers are only added to empty source chains
header
&Header
workspace
&SysValidationWorkspace
header
&Header
workspace
&SysValidationWorkspace