summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plop.erl12
-rw-r--r--src/test/plop_test.erl6
2 files changed, 4 insertions, 14 deletions
diff --git a/src/plop.erl b/src/plop.erl
index 8af6418..3cc3205 100644
--- a/src/plop.erl
+++ b/src/plop.erl
@@ -11,7 +11,7 @@
-include_lib("public_key/include/public_key.hrl").
-include_lib("eunit/include/eunit.hrl").
--export([start/2, loop/1, dummy_add/1]).
+-export([start/2, loop/1]).
-record(plop, {pubkey :: public_key:rsa_public_key(),
privkey :: public_key:rsa_private_key(),
@@ -62,10 +62,9 @@ handle_req(From,
case Arg of
{add, PlopData = #plop_data{entry = Entry}} when is_record(Entry, plop_entry) ->
%% fixme: add Entry to db,
- H = ht:append(Tree, serialise(Entry)),
+ ht:append(Tree, serialise(Entry)),
SPT = spt(LogID, Privkey, PlopData),
- %%io:format("adding ~p to ~p -> H: ~p, SPT: ~p~n",
- [Entry, Tree, H, SPT]),
+ %% io:format("adding ~p to ~p -> H: ~p, SPT: ~p~n", [Entry, Tree, H, SPT]),
From ! {ok, SPT};
sth -> % Signed tree head.
From ! {ok, sth(Tree)};
@@ -153,11 +152,6 @@ public_key(#'RSAPrivateKey'{modulus = Mod, publicExponent = Exp}) ->
#'RSAPublicKey'{modulus = Mod, publicExponent = Exp}.
%%%%%%%%%%%%%%%%%%%%
-%% Playing around
-dummy_add(String) ->
- String.
-
-%%%%%%%%%%%%%%%%%%%%
%% Tests.
serialise_test_() ->
Entry = #plop_entry{type = ?PLOP_ENTRY_TYPE_X509, entry = "foo"},
diff --git a/src/test/plop_test.erl b/src/test/plop_test.erl
index 0cbe5cc..6b612dd 100644
--- a/src/test/plop_test.erl
+++ b/src/test/plop_test.erl
@@ -8,8 +8,7 @@ adding_test_() ->
fun start/0,
fun stop/1,
fun (Arg) ->
- [test_simple_add(Arg),
- test_add(Arg)]
+ [test_add(Arg)]
end}}.
start() ->
@@ -22,9 +21,6 @@ stop(Pid) ->
after 500 -> false
end)].
-test_simple_add(Pid) ->
- ?_assertEqual("foo", Pid ! plop:dummy_add("foo")).
-
test_add(Pid) ->
TestVector =
<<1,247,141,118,3,148,171,128,29,143,106,97,200,179,204,166,242,98,70,185,