Skip to content

Commit

Permalink
feat: add example using postprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
dalbertom committed Oct 23, 2024
1 parent fb8e581 commit a83fe51
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/proof-of-sql/examples/census/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use proof_of_sql::{
DynamicDoryCommitment, DynamicDoryEvaluationProof, ProverSetup, PublicParameters,
VerifierSetup,
},
sql::{parse::QueryExpr, proof::QueryProof},
sql::{parse::QueryExpr, postprocessing::apply_postprocessing_steps, proof::QueryProof},
};
use rand::{rngs::StdRng, SeedableRng};
use std::{fs::File, time::Instant};
Expand Down Expand Up @@ -73,11 +73,12 @@ fn prove_and_verify_query(
&verifier_setup,
)
.unwrap();
let result = apply_postprocessing_steps(result.table, query_plan.postprocessing());
println!("Verified in {} ms.", now.elapsed().as_secs_f64() * 1000.);

// Display the result
println!("Query Result:");
println!("{:?}", result.table);
println!("{result:?}");
}

fn main() {
Expand Down Expand Up @@ -112,7 +113,7 @@ fn main() {
&verifier_setup,
);
prove_and_verify_query(
"SELECT Geography, COUNT(*) AS num_geographies FROM income GROUP BY Geography",
"SELECT Geography, COUNT(*) AS num_geographies FROM income GROUP BY Geography ORDER BY num_geographies",
&accessor,
&prover_setup,
&verifier_setup,
Expand Down

0 comments on commit a83fe51

Please sign in to comment.