diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-09-15 14:56:03 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-09-15 14:56:03 +0200 |
commit | 53ffb78d8e89d8428ea3728e0cec31d54f7b1c4c (patch) | |
tree | 1fa6e4f8770494419fe258a58d5fc974f122ab5d /src | |
parent | edba600ece2e0192e70a9cbe4861e9bcf10f3865 (diff) |
Encode get-sth-consistency and get-proof-by-hash properly.
Diffstat (limited to 'src')
-rw-r--r-- | src/v1.erl | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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, |