pub fn must_get_header(
    header_hash: HoloHash<Header>
) -> Result<SignedHashed<Header>, WasmError>
Expand description

MUST get a SignedHeaderHashed at a given HeaderHash.

The SignedHeaderHashed is NOT guaranteed to be a valid (or even validated) Element. For example, an invalid Header could be published and must_get_header would return the SignedHeaderHashed.

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

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

A SignedHeaderHashed will NOT be returned if:

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

If a SignedHeaderHashed fails to be returned:

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