summaryrefslogtreecommitdiff
path: root/src/ht.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ht.erl')
-rw-r--r--src/ht.erl25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/ht.erl b/src/ht.erl
index 12ce4e3..b4c7401 100644
--- a/src/ht.erl
+++ b/src/ht.erl
@@ -35,6 +35,7 @@
code_change/3]).
-export([testing_get_state/0, print_tree/0, print_tree/1]).
+-import(stacktrace, [call/2]).
-include_lib("eunit/include/eunit.hrl").
-import(lists, [foreach/2, foldl/3, reverse/1]).
@@ -51,30 +52,30 @@ start_link() ->
start_link(NEntries) ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [NEntries], []).
reset_tree(Arg) ->
- gen_server:call(?MODULE, {reset_tree, Arg}).
+ call(?MODULE, {reset_tree, Arg}).
stop() ->
- gen_server:call(?MODULE, stop).
+ call(?MODULE, stop).
size() ->
- gen_server:call(?MODULE, size).
+ call(?MODULE, size).
add(Hash) ->
- gen_server:call(?MODULE, {add, Hash}).
+ call(?MODULE, {add, Hash}).
root() ->
- gen_server:call(?MODULE, root).
+ call(?MODULE, root).
root(Version) ->
- gen_server:call(?MODULE, {root, Version}).
+ call(?MODULE, {root, Version}).
path(I, V) ->
- gen_server:call(?MODULE, {path, I, V}).
+ call(?MODULE, {path, I, V}).
consistency(V1, V2) ->
- gen_server:call(?MODULE, {consistency, V1, V2}).
+ call(?MODULE, {consistency, V1, V2}).
leaf_hash(Data) ->
- gen_server:call(?MODULE, {leaf_hash, Data}).
+ call(?MODULE, {leaf_hash, Data}).
%% Testing and debugging.
testing_get_state() ->
- gen_server:call(?MODULE, testing_get_state).
+ call(?MODULE, testing_get_state).
print_tree() ->
- gen_server:call(?MODULE, {print_tree, 4}).
+ call(?MODULE, {print_tree, 4}).
print_tree(HashOutputLen) ->
- gen_server:call(?MODULE, {print_tree, HashOutputLen}).
+ call(?MODULE, {print_tree, HashOutputLen}).
%% gen_server callbacks
init(Args) ->