Skip to content

Commit b270fec

Browse files
authored
Fixes to be able to publish crates (#707)
* Add description and some metadata for crates.io * Description and license for Felt * Rename Felt crate * Pin deps * Fixes to Cargo.toml * Fix references to cairo_rs * Bump crate version
1 parent b892d5a commit b270fec

File tree

12 files changed

+50
-46
lines changed

12 files changed

+50
-46
lines changed

Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[workspace]
2-
members = [".", "felt"]
2+
members = [".", "felt", "./deps/parse-hyperlinks"]
33

44
[package]
5-
name = "cairo-rs"
6-
version = "0.1.0"
5+
name = "cairo-vm"
6+
version = "0.1.1"
77
edition = "2021"
8+
license = "MIT"
9+
description = "Blazing fast Cairo interpreter"
810

911
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1012

@@ -31,14 +33,14 @@ nom = "7"
3133
sha2 = {version="0.10.2", features=["compress"]}
3234
thiserror = "1.0.32"
3335
generic-array = "0.14.6"
36+
keccak = "0.1.2"
3437
# This crate has only one function `take_until_unbalanced` that is
3538
# very useful for our parsing purposes:
3639
# https://stackoverflow.com/questions/70630556/parse-allowing-nested-parentheses-in-nom
3740
# There is a proposal for extending nom::delimited to use this function:
3841
# https://github.com/Geal/nom/issues/1253
39-
keccak = "0.1.2"
40-
parse-hyperlinks = { path = "./deps/parse-hyperlinks" }
41-
felt = { path = "./felt" }
42+
parse-hyperlinks = { path = "./deps/parse-hyperlinks", version = "0.23.4" }
43+
felt = { package = "cairo-felt", path = "./felt", version = "0.1.0" }
4244

4345
[dev-dependencies]
4446
iai = "0.1"

bench/criterion_benchmark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::path::Path;
22

3-
use cairo_rs::{
3+
use cairo_vm::{
44
cairo_run,
55
hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor,
66
};

bench/iai_benchmark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::path::Path;
22

3-
use cairo_rs::{
3+
use cairo_vm::{
44
cairo_run::cairo_run,
55
hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor,
66
vm::errors::cairo_run_errors::CairoRunError, vm::runners::cairo_runner::CairoRunner,

custom_hint_example/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use cairo_rs::cairo_run::cairo_run;
2-
use cairo_rs::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::{
1+
use cairo_vm::cairo_run::cairo_run;
2+
use cairo_vm::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::{
33
BuiltinHintProcessor, HintFunc,
44
};
5-
use cairo_rs::hint_processor::builtin_hint_processor::hint_utils::get_integer_from_var_name;
6-
use cairo_rs::hint_processor::hint_processor_definition::HintReference;
7-
use cairo_rs::types::exec_scope::ExecutionScopes;
8-
use cairo_rs::serde::deserialize_program::ApTracking;
9-
use cairo_rs::vm::{errors::hint_errors::HintError, vm_core::VirtualMachine};
5+
use cairo_vm::hint_processor::builtin_hint_processor::hint_utils::get_integer_from_var_name;
6+
use cairo_vm::hint_processor::hint_processor_definition::HintReference;
7+
use cairo_vm::types::exec_scope::ExecutionScopes;
8+
use cairo_vm::serde::deserialize_program::ApTracking;
9+
use cairo_vm::vm::{errors::hint_errors::HintError, vm_core::VirtualMachine};
1010
use num_bigint::BigInt;
1111
use std::collections::HashMap;
1212
use std::path::Path;

docs/hint_processor/builtin_hint_processor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ let hint = HintFunc(Box::new(print_a_hint));
6060
#### Step 3: Instantiate the BuiltinHintProcessor and add your custom hint implementation
6161
Import the BuiltinHintProcessor from cairo-rs, instantiate it using the `new_empty()` method and the add your custom hint implementation using the method `add_hint`
6262
```rust
63-
use cairo_rs::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor
63+
use cairo_vm::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor
6464

6565
let mut hint_processor = BuiltinHintProcessor::new_empty();
6666
hint_processor.add_hint(String::from("print(ids.a)"), hint);
@@ -71,7 +71,7 @@ You can also create a dictionary of HintFunc and use the method `new()` to creat
7171
Import the function cairo_run from cairo-rs, and run your compiled program
7272

7373
```rust
74-
use cairo_rs::cairo_run::cairo_run;
74+
use cairo_vm::cairo_run::cairo_run;
7575
cairo_run(
7676
Path::new("custom_hint.json"),
7777
"main",

felt/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
[package]
2-
name = "felt"
2+
name = "cairo-felt"
33
version = "0.1.0"
44
edition = "2021"
5+
license = "MIT"
6+
description = "Field elements representation for the Cairo VM"
57

68
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
79

810
[dependencies]
9-
num-integer = "*"
11+
num-integer = "0.1.45"
1012
num-bigint = { version = "0.4", features = ["serde"] }
11-
num-traits = "*"
12-
lazy_static = "*"
13+
num-traits = "0.2.15"
14+
lazy_static = "1.4.0"
1315
serde = { version = "1.0", features = ["derive"] }
1416

1517
[dev-dependencies]

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![deny(warnings)]
2-
use cairo_rs::cairo_run;
3-
use cairo_rs::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor;
4-
use cairo_rs::vm::errors::cairo_run_errors::CairoRunError;
5-
use cairo_rs::vm::errors::runner_errors::RunnerError;
6-
use cairo_rs::vm::errors::trace_errors::TraceError;
2+
use cairo_vm::cairo_run;
3+
use cairo_vm::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor;
4+
use cairo_vm::vm::errors::cairo_run_errors::CairoRunError;
5+
use cairo_vm::vm::errors::runner_errors::RunnerError;
6+
use cairo_vm::vm::errors::trace_errors::TraceError;
77
use clap::{Parser, ValueHint};
88
use std::path::PathBuf;
99

tests/bitwise_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use cairo_rs::{
1+
use cairo_vm::{
22
hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor,
33
types::program::Program,
44
vm::{

tests/cairo_run_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use cairo_rs::cairo_run;
2-
use cairo_rs::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor;
1+
use cairo_vm::cairo_run;
2+
use cairo_vm::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor;
33
use std::path::Path;
44

55
#[test]

0 commit comments

Comments
 (0)