From 53ffb78d8e89d8428ea3728e0cec31d54f7b1c4c Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 15 Sep 2014 14:56:03 +0200 Subject: Encode get-sth-consistency and get-proof-by-hash properly. --- src/v1.erl | 10 ++++++---- 1 file 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, -- cgit v1.1