Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into delete-unused-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoPittella committed Jun 6, 2023
2 parents 853c16f + 8f89001 commit 113a3fc
Show file tree
Hide file tree
Showing 56 changed files with 925 additions and 608 deletions.
119 changes: 28 additions & 91 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ edition = "2021"
default = ["with_mimalloc"]
with_mimalloc = ["mimalloc"]

[workspace]
members = ["crates/starknet-contract-class", "fuzzer", "cli"]

[workspace.dependencies]
cairo-vm = { git = "https://github.com/lambdaclass/cairo-rs", rev = "de6a2327b7e629336bc2431787c8e28c3b0f1349" }

[dependencies]
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "4afacfd574de1121d61dea28f8c73e1516c7e07d"}
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "4afacfd574de1121d61dea28f8c73e1516c7e07d"}
cairo-vm = { git = "https://github.com/lambdaclass/cairo-rs", features = ["cairo-1-hints"], rev = "de6a2327b7e629336bc2431787c8e28c3b0f1349" }
cairo-vm = { workspace=true, features = ["cairo-1-hints"] }
getset = "0.1.2"
lazy_static = "1.4.0"
num-bigint = { version = "0.4", features = ["serde"] }
Expand All @@ -36,9 +42,6 @@ once_cell = "1.17.1"
assert_matches = "1.5.0"
coverage-helper = "0.1.0"

[workspace]
members = ["crates/starknet-contract-class", "fuzzer", "cli"]

[[bench]]
path = "bench/internals.rs"
name = "internals"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ awc = "3.1.1"
mimalloc = { version = "0.1.29", default-features = false, optional = true }
hex = "0.4.3"
cargo-llvm-cov = "0.5.14"
starknet-rs = { path = "../" }
starknet-rs = { path = "..", version = "0.1.0" }
starknet-contract-class = { path = "../crates/starknet-contract-class" }

[dev-dependencies]
Expand Down
12 changes: 9 additions & 3 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use starknet_rs::{
},
core::{
contract_address::compute_deprecated_class_hash,
errors::contract_address_errors::ContractAddressError,
errors::{contract_address_errors::ContractAddressError, state_errors::StateError},
transaction_hash::{
calculate_declare_transaction_hash, calculate_deploy_transaction_hash,
calculate_transaction_hash_common, TransactionHashPrefix,
Expand Down Expand Up @@ -158,7 +158,10 @@ fn invoke_parser(
.map_err(|_| ParserError::ParseFelt(args.address.clone()))?,
);
let class_hash = cached_state.get_class_hash_at(&contract_address)?;
let contract_class = cached_state.get_contract_class(&class_hash)?;
let contract_class: ContractClass = cached_state
.get_contract_class(&class_hash)?
.try_into()
.map_err(StateError::from)?;
let function_entrypoint_indexes = read_abi(&args.abi);
let transaction_hash = args.hash.clone().map(|f| {
Felt252::from_str_radix(&f, 16)
Expand Down Expand Up @@ -218,7 +221,10 @@ fn call_parser(
.map_err(|_| ParserError::ParseFelt(args.address.clone()))?,
);
let class_hash = cached_state.get_class_hash_at(&contract_address)?;
let contract_class = cached_state.get_contract_class(&class_hash)?;
let contract_class: ContractClass = cached_state
.get_contract_class(&class_hash)?
.try_into()
.map_err(StateError::from)?;
let function_entrypoint_indexes = read_abi(&args.abi);
let entry_points_by_type = contract_class.entry_points_by_type().clone();
let (entry_point_index, entry_point_type) = function_entrypoint_indexes
Expand Down
1 change: 1 addition & 0 deletions crates/starknet-contract-class/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
[dependencies]
serde = "1.0.156"
serde_json = "1.0.94"
getset = "0.1.2"

[dependencies.cairo-vm]
git = "https://github.com/lambdaclass/cairo-rs.git"
Expand Down
Loading

0 comments on commit 113a3fc

Please sign in to comment.