summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ht.erl11
1 files changed, 10 insertions, 1 deletions
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();