find_unique_match_rec

Function find_unique_match_rec 

Source
pub fn find_unique_match_rec<PT: ProtocolTypes>(
    path_to_search: &[usize],
    eval_tree: &EvalTree,
    whole_term: &Term<PT>,
    is_to_search_in_list: bool,
) -> Result<(usize, bool), Error>
Expand description

Goal: locate byte position of to_search := eval_tree[path_to_search].encode in root_eval:=eval_tree[vec![]].encode (=whole_term.encode(ctx)) by traversing eval_tree until reaching node at pat_to_search. Assumptions:

  • encoded arguments of a term can be found in this same order in the evaluation of the father node
  • there can be headers of arbitrary length
  • no trailer (no bytes added after the last argument encoding) Also returns a boolean flag envcountered_get_symbol indicating whether a get symbol is between the root and the path_to_search, in which case, inconsistencies might occur.