Function hdk::prelude::must_get_action

source ·
pub fn must_get_action(
    action_hash: HoloHash<Action>
) -> Result<SignedHashed<Action>, WasmError>
Expand description

MUST get a SignedActionHashed at a given ActionHash.

The SignedActionHashed is NOT guaranteed to be a valid (or even validated) Record. For example, an invalid Action could be published and must_get_action would return the SignedActionHashed.

This may be useful during validation callbacks where the validity depends on an action existing regardless of its associated Entry. For example, we may simply need to check that the author is the same for two referenced Actions.

must_get_action is available in contexts such as validation where both determinism and network access is desirable.

A SignedActionHashed will NOT be returned if:

  • @TODO The action is WITHDRAWN by the author
  • @TODO The action is ABANDONED by ALL authorities
  • Nobody knows about it on the currently visible network

If a SignedActionHashed fails to be returned:

  • Callbacks will return early with UnresolvedDependencies
  • Zome calls will receive a WasmError from the host