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: network_call_tests.rs
    path of file: ./repos/holochain/crates/holochain/src/core/workflow/app_validation_workflow
    
    the code of the file until where you have to start completion: use fallible_iterator::FallibleIterator;
use hdk::prelude::EntryType;
use hdk::prelude::Record;
use holo_hash::ActionHash;
use holochain_p2p::actor::GetActivityOptions;
use holochain_p2p::HolochainP2pDnaT;
use holochain_sqlite::fresh_reader_test;
use holochain_test_wasm_common::AgentActivitySearch;
use holochain_types::prelude::*;
use holochain_wasm_test_utils::TestWasm;
use matches::assert_matches;

use crate::conductor::ConductorHandle;
use crate::test_utils::conductor_setup::CellHostFnCaller;
use crate::test_utils::host_fn_caller::Post;
use crate::test_utils::new_zome_call_unsigned;
use crate::test_utils::wait_for_integration;
use holochain_cascade::Cascade;
use holochain_cascade::DbPair;
use holochain_cascade::DbPairMut;
use holochain_state::metadata::ChainItemKey;
use holochain_state::metadata::MetadataBuf;
use holochain_state::metadata::MetadataBufT;
use holochain_state::record_buf::RecordBuf;
use holochain_state::source_chain::SourceChain;

const NUM_COMMITS: usize = 5;
const GET_AGENT_ACTIVITY_TIMEOUT_MS: u64 = 1000;
// Check if the correct number of ops are integrated
// every 100 ms for a maximum of 10 seconds but early exit
// if they are there.
const NUM_ATTEMPTS: usize = 100;
const DELAY_PER_ATTEMPT: std::time::Duration = std::time::Duration::from_millis(100);

#[tokio::test(flavor = "multi_thread")]
async fn get_agent_activity_test() {
    holochain_trace::test_run().ok();

    let zomes = vec![TestWasm::Create];
    let mut conductor_test = ConductorTestData::two_agents(zomes, false).await;
    let handle = conductor_test.raw_handle();
    let alice_call_data = conductor_test.alice_call_data_mut();
    let alice_cell_id = &alice_call_data.cell_id;
    let alice_agent_id = alice_cell_id.agent_pubkey();
    let alice_db = alice_call_data.db.clone();

    // Helper for getting expected data
    let get_expected_full = || {
        let alice_source_chain = SourceChain::public_only(alic
    
async fn get_agent_activity_host_fn_test() {
    holochain_trace::test_run().ok();

    let zomes = vec![TestWasm::Create];
    let mut conductor_test = ConductorTestData::two_agents(zomes, false).await;
    let handle = conductor_test.raw_handle();
    let alice_call_data = conductor_test.alice_call_data();
    let alice_cell_id = &alice_call_data.cell_id;
    let alice_agent_id = alice_cell_id.agent_pubkey();
    let alice_db = alice_call_data.db.clone();

    // Helper for getting expected data
    let get_expected = || {
        let alice_source_chain = SourceChain::public_only(alice_db.clone().into()).unwrap();
        let valid_activity = alice_source_chain
            .iter_back()
            .collect::<Vec<_>>()
            .unwrap()
            .into_iter()
            .rev()
            .map(|shh| (shh.action().action_seq(), shh.action_address().clone()))
            .collect::<Vec<_>>();
        let last = valid_activity.last().cloned().unwrap();
        let status = ChainStatus::Valid(ChainHead {
            action_seq: last.0,
            hash: last.1.clone(),
        });
        let highest_observed = Some(HighestObserved {
            action_seq: last.0,
            hash: vec![last.1.clone()],
        });

        holochain_zome_types::query::AgentActivity {
            valid_activity: valid_activity,
            rejected_activity: Vec::new(),
            status,
            highest_observed,
            warrants: Vec::new(),
        }
    };

    commit_some_data("create_entry", &alice_call_data, &handle).await;

    // 3 ops per commit, 5 commits plus 7 for genesis + 2 for init
    let expected_count = NUM_COMMITS * 3 + 9;

    wait_for_integration(
        &alice_call_data.db,
        expected_count,
        NUM_ATTEMPTS,
        DELAY_PER_ATTEMPT.clone(),
    )
    .await;

    let agent_activity = alice_call_data
        .get_api(TestWasm::Create)
        .get_agent_activity(
            alice_agent_id,
            &ChainQueryFilter::new(),
            ActivityRequest::Full,
        )
        .await;
    let expected_activity = get_expected();
    assert_eq!(agent_activity, expected_activity);

    let search = AgentActivitySearch {
        agent: alice_agent_id.clone(),
        query: ChainQueryFilter::new(),
        request: ActivityRequest::Full,
    };
    let invocation = new_zome_call(
        &alice_call_data.cell_id,
        "get_activity",
        search,
        TestWasm::Create,
    )
    .unwrap();
    let result = handle.call_zome(invocation).await.unwrap().unwrap();
    let agent_activity: holochain_zome_types::query::AgentActivity =
        unwrap_to::unwrap_to!(result => ZomeCallResponse::Ok)
            .decode()
            .unwrap();
    assert_eq!(agent_activity, expected_activity);
    conductor_test.shutdown_conductor().await;
}