pub async fn check_valid_if_dna(
    header: &Header,
    meta_vault: &impl MetadataBufT,
) -> SysValidationResult<()> {
    fresh_reader!(meta_vault.env(), |r| {
        match header {
            Header::Dna(_) => meta_vault
                .get_activity(&r, ChainItemKey::Agent(header.author().clone()))?
                .next()?
                .map_or(Ok(()), |_| {
                    Err(PrevHeaderError::InvalidRoot).map_err(|e| ValidationOutcome::from(e).into())
                }),
            _ => Ok(()),
        }
    })
}
/// Check that Dna headers are only added to empty source chains
Check that Dna headers are only added to empty source chains
Check that Dna headers are only added to empty source chains
pub async fn check_valid_if_dna(
    header: &Header,
    meta_vault: &impl MetadataBufT,
) -> SysValidationResult<()> {
    fresh_reader!(meta_vault.env(), |r| {
        match header {
            Header::Dna(_) => meta_vault
                .get_activity(&r, ChainItemKey::Agent(header.author().clone()))?
                .next()?
                .map_or(Ok(()), |_| {
                    Err(PrevHeaderError::InvalidRoot).map_err(|e| ValidationOutcome::from(e).into())
                }),
            _ => Ok(()),
        }
    })
}
pub async fn check_valid_if_dna ( header : & Header , meta_vault : & impl MetadataBufT , ) -> SysValidationResult < ( ) > { fresh_reader ! ( meta_vault env ( ) r { match header { Header Dna ( ) meta_vault get_activity ( r ChainItemKey Agent ( header author ( ) clone ( ) ) ) next ( ) map_or ( Ok ( ( ) ) { Err ( PrevHeaderError InvalidRoot ) map_err ( e ValidationOutcome from ( e ) into ( ) ) } ) Ok ( ( ) ) } } ) }
Check that Dna headers are only added to empty source chains
Check that Dna headers are only added to empty source chains
header
&Header
meta_vault
&impl MetadataBufT
header
&Header
meta_vault
&impl MetadataBufT