summaryrefslogtreecommitdiff
path: root/src/v1.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/v1.erl')
-rw-r--r--src/v1.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/v1.erl b/src/v1.erl
index 2ca7726..dca1402 100644
--- a/src/v1.erl
+++ b/src/v1.erl
@@ -61,8 +61,9 @@
false ->
binary_to_list(
jiffy:encode(
- [base64:encode(X) ||
- X <- plop:consistency(First, Second)]))
+ {[{consistency,
+ [base64:encode(X) ||
+ X <- plop:consistency(First, Second)]}]}))
end;
_ -> html("get-sth-consistency: bad input:", Input)
end,
@@ -81,10 +82,11 @@
html("get-proof-by-hash: bad input:",
[HashInput, TreeSizeInput]);
false ->
+ {Index, Path} = plop:inclusion(Hash, TreeSize),
binary_to_list(
jiffy:encode(
- [base64:encode(X) ||
- X <- plop:inclusion(Hash, TreeSize)]))
+ {[{leaf_index, Index},
+ {audit_path, [base64:encode(X) || X <- Path]}]}))
end;
_ -> html("get-sth-proof-by-hash: bad input:", Input)
end,