pub fn must_get_entry(entry_hash: EntryHash) -> ExternResult<EntryHashed>
Expand description

MUST get an EntryHashed at a given EntryHash.

The EntryHashed is NOT guaranteed to be associated with a valid (or even validated) Header/Element. For example, an invalid Element could be published and must_get_entry would return the EntryHashed.

This may be useful during validation callbacks where the validity and relevance of some content can be asserted by the CURRENT validation callback independent of an Element. This behaviour avoids the potential for eclipse attacks to lie about the validity of some data and cause problems for a hApp. If you NEED to know that a dependency is valid in order for the current validation logic (e.g. inductive validation of a tree) then must_get_valid_element is likely what you need.

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

An EntryHashed will NOT be returned if:

  • @TODO It is PURGED (community redacted entry)
  • @TODO ALL headers pointing to it are WITHDRAWN by the authors
  • ALL headers pointing to it are ABANDONED by ALL authorities due to validation failure
  • Nobody knows about it on the currently visible network

If an EntryHashed fails to be returned:

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