Function holochain::core::check_and_hold_register_agent_activity
source · pub async fn check_and_hold_register_agent_activity<F>(
hash: &ActionHash,
workspace: &SysValidationWorkspace,
network: HolochainP2pDna,
incoming_dht_ops_sender: Option<IncomingDhtOpSender>,
f: F
) -> SysValidationResult<()>where
F: FnOnce(&Record) -> SysValidationResult<()>,
Expand description
If we are not holding this action then retrieve it and send it as a RegisterAgentActivity DhtOp to our incoming_dht_ops_workflow.
Apply a checks callback to the Record.
Additionally sys validation will be triggered to run again if we weren’t holding it.
Examples found in repository?
src/core/workflow/sys_validation_workflow.rs (lines 571-577)
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582
async fn register_agent_activity(
action: &Action,
workspace: &SysValidationWorkspace,
network: HolochainP2pDna,
incoming_dht_ops_sender: Option<IncomingDhtOpSender>,
) -> SysValidationResult<()> {
// Get data ready to validate
let prev_action_hash = action.prev_action();
// Checks
check_prev_action(action)?;
check_valid_if_dna(action, workspace).await?;
if let Some(prev_action_hash) = prev_action_hash {
check_and_hold_register_agent_activity(
prev_action_hash,
workspace,
network,
incoming_dht_ops_sender,
|_| Ok(()),
)
.await?;
}
check_chain_rollback(action, workspace).await?;
Ok(())
}