diff --git a/Cargo.toml b/Cargo.toml index 313f833f9..294a457b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ version = "0.1.0" [workspace.dependencies] anyhow = "1" -cairo-felt = "0.9" cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo/", version = "~2.8.2"} cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo/", version = "~2.8.2"} cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo/", version = "~2.8.2"} @@ -20,5 +19,6 @@ num-bigint = "0.4.4" runner = { path = "runner" } serde = { version = "1", features = ["derive"] } serde_json = "1" +starknet-types-core = "0.1.5" swiftness_proof_parser = { git = "https://github.com/iosis-tech/swiftness", rev = "a53d65ecbd7acf4611b0d587d815f4e9d4d493ed"} thiserror = "1.0" \ No newline at end of file diff --git a/benches/Cargo.toml b/benches/Cargo.toml index 83e806f79..cfae45f2b 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -7,7 +7,6 @@ edition = "2021" [dependencies] anyhow.workspace = true -cairo-felt.workspace = true cairo-lang-runner.workspace = true cairo-lang-sierra.workspace = true cairo-lang-utils.workspace = true diff --git a/runner/Cargo.toml b/runner/Cargo.toml index 083db7100..4c5cec960 100644 --- a/runner/Cargo.toml +++ b/runner/Cargo.toml @@ -7,7 +7,6 @@ edition.workspace = true [dependencies] anyhow.workspace = true -cairo-felt.workspace = true cairo-lang-casm.workspace = true cairo-lang-runner.workspace = true cairo-lang-sierra.workspace = true @@ -18,5 +17,6 @@ itertools.workspace = true num-bigint.workspace = true serde_json.workspace = true serde.workspace = true +starknet-types-core.workspace = true swiftness_proof_parser.workspace = true thiserror.workspace = true \ No newline at end of file diff --git a/runner/src/lib.rs b/runner/src/lib.rs index c2ef97781..4e920cde5 100644 --- a/runner/src/lib.rs +++ b/runner/src/lib.rs @@ -1,7 +1,7 @@ pub mod transform; pub mod vec252; -use cairo_felt::Felt252; +use cairo_vm::Felt252; use clap::ValueEnum; pub use vec252::VecFelt252; @@ -48,4 +48,4 @@ impl From for Felt252 { HasherBitLength::Lsb248 => Felt252::from(1), } } -} \ No newline at end of file +} diff --git a/runner/src/vec252.rs b/runner/src/vec252.rs index b6e69540c..a3786a84a 100644 --- a/runner/src/vec252.rs +++ b/runner/src/vec252.rs @@ -1,4 +1,4 @@ -use cairo_felt::Felt252; +use cairo_vm::Felt252; use serde::{de::Visitor, Deserialize}; use serde_json::Value; use std::{ops::Deref, str::FromStr}; @@ -12,6 +12,8 @@ pub enum VecFelt252Error { BigIntParseError(#[from] num_bigint::ParseBigIntError), #[error("number out of range")] NumberOutOfRange, + #[error("failed to parse felt: {0}")] + FeltParseError(#[from] starknet_types_core::felt::FromStrError), } /// `VecFelt252` is a wrapper around a vector of `Arg`. @@ -77,8 +79,7 @@ impl VecFelt252 { args.push(Felt252::from(n)); } Value::String(n) => { - let n = num_bigint::BigUint::from_str(n)?; - args.push(Felt252::from_bytes_be(&n.to_bytes_be())); + args.push(Felt252::from_str(n)?); } Value::Array(a) => { args.push(Felt252::from(a.len()));