From d5eb39105e320d5d830f2df6e5f38c5385e4c5be Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 21 Apr 2014 19:52:30 +0200 Subject: Add placeholder for audit_path/2. --- src/ht.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ht.erl b/src/ht.erl index 97842bc..68c3c67 100644 --- a/src/ht.erl +++ b/src/ht.erl @@ -14,7 +14,8 @@ -type inner() :: #inner{}. -export_type([head/0, tree/0, inner/0, leaf/0]). --export([create/1, append/2, tree_hash/1, tree_version/1]). +-export([create/1, append/2, tree_hash/1, tree_version/1, + audit_path/2]). %% Public interface. -spec create(iolist() | binary()) -> head(). @@ -71,6 +72,14 @@ append(Dest, Newtree, 0) when is_record(Dest, inner) -> append(Dest, Newtree, Depth) when is_record(Dest, inner) -> mkinner(Dest#inner.child0, append(Dest#inner.child1, Newtree, Depth - 1)). +%% @doc return a list of those hashes needed to calculate the tree +%% hash for Head given the knowledge of the hash in entry with number +%% Index. +-spec audit_path(head(), non_neg_integer()) -> list(). +audit_path(Head, Index) -> + [fixme, Head, Index]. + +%%%%%%%%%%%%%%%%%%%% %% Private functions. -spec mkhead(non_neg_integer(), tree()) -> head(); -- cgit v1.1