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: deterministic.rs
    path of file: ./repos/holochain/crates/holochain_cascade/src/authority/get_agent_activity_query
    
    the code of the file until where you have to start completion: //! Query for `deterministic_get_agent_activity`, designed for use in
//! validation callbacks.
//!
//! This is a deterministic version of `get_agent_activity`, designed such that
//! there can only be one possible valid result which satisfies the query
//! criteria, so if you get back a result, you can verify t
    
    async fn agent_activity_query() {
        holochain_trace::test_run().ok();
        let test_db = test_dht_db();
        let db = test_db.to_db();
        let entry_type_1 = fixt!(EntryType);
        let agents = [fixt!(AgentPubKey), fixt!(AgentPubKey), fixt!(AgentPubKey)];
        let mut chains = vec![];

        for a in 0..3 {
            let mut chain: Vec<ActionHash> = Vec::new();
            for seq in 0..10 {
                let action: Action = if let Some(top) = chain.last() {
                    let mut action = fixt!(Create);
                    action.entry_type = entry_type_1.clone();
                    action.author = agents[a].clone();
                    action.prev_action = top.clone();
                    action.action_seq = seq;
                    let entry = Entry::App(fixt!(AppEntryBytes));
                    action.entry_hash = EntryHash::with_data_sync(&entry);
                    action.into()
                } else {
                    let mut action = fixt!(Dna);
                    action.author = agents[a].clone();
                    action.into()
                };
                chain.push(ActionHash::with_data_sync(&action));
                let op = DhtOp::RegisterAgentActivity(fixt!(Signature), action);
                let op = DhtOpHashed::from_content_sync(op);
                fill_db(&db, op).await;
            }
            chains.push(chain);
        }

        let filter_full = DeterministicGetAgentActivityFilter {
            range: (None, chains[2].last().unwrap().clone()),
            entry_type: Some(entry_type_1.clone()),
            action_type: None,
            include_entries: false,
        };

        let filter_partial = DeterministicGetAgentActivityFilter {
            range: (Some(chains[2][4].clone()), chains[2][8].clone()),
            entry_type: Some(entry_type_1),
            action_type: None,
            include_entries: false,
        };
        let options = GetActivityOptions::default();

        let results_full = crate::authority::handle_get_agent_activity_deterministic(
            db.clone().into(),
            agents[2].clone(),
            filter_full,
            options.clone(),
        )
        .await
        .unwrap();

        let results_partial = crate::authority::handle_get_agent_activity_deterministic(
            db.clone().into(),
            agents[2].clone(),
            filter_partial,
            options,
        )
        .await
        .unwrap();

        assert_eq!(results_full.chain.len(), 10);
        assert_eq!(results_partial.chain.len(), 5);
    }