implement the specified sparse merkletree (#82)
* wip * prototype custom predicates 1b * feat: implement custom pred recursion * files reorg, add github CI for rustfmt checks * start sparsemerkletree. impl add_leaf method, initial Leaf & Intermediate types with methods * mt: add hash computation of all the nodes in the tree, add method to print the tree to visualize it as a graphviz * mt: add (till the leaf) method which is used by get,contains,prove methods * mt: add verify (of inclusion) method * mt: update 'down' method to reuse siblings, update get,contains,prove methods (the three use 'down' under the hood) * Add nonexistence proofs and iterator * Add iterator test * migrate usage of old merkletree to the new merkletree impl in POD2 code --------- Co-authored-by: Eduard S. <eduardsanou@posteo.net> Co-authored-by: Ahmad <root@ahmadafuni.com>
This commit is contained in:
parent
2e9719a1ca
commit
c101d94530
9 changed files with 649 additions and 198 deletions
|
|
@ -485,7 +485,7 @@ pub mod tests {
|
|||
pk: "ZooDeel".into(),
|
||||
};
|
||||
let pay_stub_pod = pay_stub_builder.sign(&mut signer)?;
|
||||
let kyc_builder = zu_kyc_pod_builder(¶ms, &gov_id_pod, &pay_stub_pod);
|
||||
let kyc_builder = zu_kyc_pod_builder(¶ms, &gov_id_pod, &pay_stub_pod)?;
|
||||
|
||||
let mut prover = MockProver {};
|
||||
let kyc_pod = kyc_builder.prove(&mut prover)?;
|
||||
|
|
@ -501,7 +501,7 @@ pub mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_mock_main_great_boy() -> Result<()> {
|
||||
let great_boy_builder = great_boy_pod_full_flow();
|
||||
let great_boy_builder = great_boy_pod_full_flow()?;
|
||||
|
||||
let mut prover = MockProver {};
|
||||
let great_boy_pod = great_boy_builder.prove(&mut prover)?;
|
||||
|
|
@ -520,7 +520,7 @@ pub mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_mock_main_tickets() -> Result<()> {
|
||||
let tickets_builder = tickets_pod_full_flow();
|
||||
let tickets_builder = tickets_pod_full_flow()?;
|
||||
let mut prover = MockProver {};
|
||||
let proof_pod = tickets_builder.prove(&mut prover)?;
|
||||
let pod = proof_pod.pod.into_any().downcast::<MockMainPod>().unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue