You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: facts.rs
    path of file: ./repos/holochain/crates/holochain_zome_types/src
    
    the code of the file until where you have to start completion: //! Contrafact Facts for types in this crate

use crate::prelude::*;
use contrafact::*;

/// Action is of a given type
pub fn is_of
    
    fn test_valid_chain_fact() {
        let mut g = unstructured_noise().into();
        let author = ::fixt::fixt!(AgentPubKey);
        let fact = valid_chain(5, author.clone());
        let chain = fact.clone().build(&mut g);
        fact.check(&chain).unwrap();

        let hashes: Vec<_> = chain.iter().map(ActionHash::with_data_sync).collect();
        let backlinks: Vec<_> = chain
            .iter()
            .filter_map(|h| h.prev_action())
            .cloned()
            .collect();
        let action_seqs: Vec<_> = chain.iter().map(|h| h.action_seq()).collect();

        // Ensure that the backlinks line up with the actual hashes
        assert_eq!(hashes[0..chain.len() - 1], backlinks[..]);
        // Ensure that the action seqs form a sequence
        assert_eq!(action_seqs, vec![0, 1, 2, 3, 4]);
    }