hdi/
chain.rs

1//! # Chain Activity
2//! This module gives users the ability to use chain activity within validation
3//! in a deterministic way.
4
5use crate::prelude::*;
6use holo_hash::AgentPubKey;
7
8/// The chain this filter produces on the given agents chain
9/// must be fetched before the validation can be completed.
10/// This allows for deterministic validation of chain activity by
11/// making a hash bounded range of an agents chain into a dependency
12/// for something that is being validated.
13///
14/// Check the [`ChainFilter`] docs for more info.
15pub fn must_get_agent_activity(
16    author: AgentPubKey,
17    filter: ChainFilter,
18) -> ExternResult<Vec<RegisterAgentActivity>> {
19    HDI.with(|h| {
20        h.borrow()
21            .must_get_agent_activity(MustGetAgentActivityInput {
22                author,
23                chain_filter: filter,
24            })
25    })
26}