Skip to content

Commit

Permalink
feat: add query for calculating total market cap and stock count
Browse files Browse the repository at this point in the history
  • Loading branch information
waelsy123 committed Oct 25, 2024
1 parent 3392b0e commit 92a801a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/proof-of-sql/examples/stocks/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,12 @@ fn main() {
OwnedTable::try_from(stocks_batch).unwrap(),
0,
);

// Query 1: Calculate total market cap and count of stocks
prove_and_verify_query(
"SELECT SUM(MarketCap) as total_market_cap, COUNT(*) as c FROM stocks",
&accessor,
&prover_setup,
&verifier_setup,
);
}

0 comments on commit 92a801a

Please sign in to comment.