Skip to content

Commit

Permalink
runner update 2.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Sep 17, 2024
1 parent 5cae122 commit 4be694e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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"
1 change: 0 additions & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions runner/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -48,4 +48,4 @@ impl From<HasherBitLength> for Felt252 {
HasherBitLength::Lsb248 => Felt252::from(1),
}
}
}
}
7 changes: 4 additions & 3 deletions runner/src/vec252.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -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`.
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit 4be694e

Please sign in to comment.