Skip to content

Commit

Permalink
Merge branch 'autogenerated_split' into autogenerated_split_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Sep 10, 2024
2 parents 6414a95 + 8c1d710 commit 23374ab
Show file tree
Hide file tree
Showing 21 changed files with 1,311 additions and 489 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo/", rev = "447
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo/", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1"}
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo/", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1"}
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo/", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1"}
cairo-proof-parser = { git = "https://github.com/Okm165/cairo-proof-parser", rev = "97a04bbee07330311b38d6f4cecfed3acb237626"}
cairo-vm = "0.9.2"
cairo-vm = "1.0.1"
clap = { version = "4.5.2", features = ["derive"] }
itertools = "0.13.0"
num-bigint = "0.4.4"
runner = { path = "runner" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
swiftness_proof_parser = { git = "https://github.com/iosis-tech/swiftness", rev = "a53d65ecbd7acf4611b0d587d815f4e9d4d493ed"}
thiserror = "1.0"
4 changes: 2 additions & 2 deletions examples/starknet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2021"

[dependencies]
anyhow.workspace = true
cairo-proof-parser.workspace = true
clap.workspace = true
itertools.workspace = true
runner.workspace = true
serde_json.workspace = true
serde.workspace = true
serde.workspace = true
swiftness_proof_parser.workspace = true
20 changes: 9 additions & 11 deletions examples/starknet/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use cairo_proof_parser::parse;
use clap::Parser;
use itertools::chain;
use runner::{CairoVersion, VecFelt252};
use runner::{transform::StarkProofExprs, CairoVersion, VecFelt252};
use std::io::{stdin, Read};
use swiftness_proof_parser::parse;

#[derive(Parser)]
#[command(author, version, about)]
Expand All @@ -17,13 +17,13 @@ fn main() -> anyhow::Result<()> {
let mut input = String::new();
stdin().read_to_string(&mut input)?;

let parsed = parse(input)?;

let config: VecFelt252 = serde_json::from_str(&parsed.config.to_string()).unwrap();
let public_input: VecFelt252 = serde_json::from_str(&parsed.public_input.to_string()).unwrap();
let stark_proof: StarkProofExprs = parse(input)?.into();
let config: VecFelt252 = serde_json::from_str(&stark_proof.config.to_string()).unwrap();
let public_input: VecFelt252 =
serde_json::from_str(&stark_proof.public_input.to_string()).unwrap();
let unsent_commitment: VecFelt252 =
serde_json::from_str(&parsed.unsent_commitment.to_string()).unwrap();
let witness: VecFelt252 = serde_json::from_str(&parsed.witness.to_string()).unwrap();
serde_json::from_str(&stark_proof.unsent_commitment.to_string()).unwrap();
let witness: VecFelt252 = serde_json::from_str(&stark_proof.witness.to_string()).unwrap();

let proof = chain!(
config.into_iter(),
Expand All @@ -32,9 +32,7 @@ fn main() -> anyhow::Result<()> {
witness.into_iter()
);

let calldata = chain!(proof, vec![cli.cairo_version.into()].into_iter());

let calldata_string = calldata
let calldata_string = chain!(proof, vec![cli.cairo_version.into()].into_iter())
.map(|f| f.to_string())
.collect::<Vec<String>>()
.join(" ");
Expand Down
Loading

0 comments on commit 23374ab

Please sign in to comment.