pub fn valid_chain<'a>(
    len: usize,
    author: HoloHash<Agent>
) -> impl Fact<'a, Vec<Action>>
Expand description

A rough check that a sequence of Actions constitutes a valid source chain

  • First action must be Dna
  • Each subsequent action’s prev_action hash must match the previous action
  • The seq number must be increasing by 1, from 0

Notably, this does NOT check the following: xxx Genesis actions in the proper place xxx Genesis actions in the wrong place

TODO: It would be more readable/composable to break this into several parts:

  • constrain action types based on position
  • constrain seq num
  • constrain prev_hashes …but, this does it all in one Fact