Skip to content

Commit

Permalink
Update cargo, pip, npm dependencies (#516)
Browse files Browse the repository at this point in the history
* Specify deps only in root Cargo.toml; remove unused num-integer

* Update CONTRIBUTING.md

* Fix triple slash docs of devnet API methods
  • Loading branch information
FabijanC authored Jul 1, 2024
1 parent 84e1339 commit aefef84
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ Updating the underlying Starknet is done by updating the `blockifier` dependency

Updating the RPC requires following the specification files in the [starknet-specs repository](https://github.com/starkware-libs/starknet-specs). The spec_reader testing utility requires these files to be copied into the Devnet repository. The `RPC_SPEC_VERSION` constant needs to be updated accordingly.

### Adding new dependencies

When adding new Rust dependencies, specify them in the root Cargo.toml and use `{ workspace = true }` in crate-specific Cargo.toml files.

### Updating documentation

The documentation website content has [its own readme](../website/README.md).
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ regex_generate = "0.2.3"
reqwest = { version = "0.12", features = ["blocking", "json"] }
url = "2.4"
usc = { version = "2.1.0", package = "universal-sierra-compiler" }
num-bigint = { version = "0.4" }

# Starknet dependencies
starknet_api = { version = "0.10.0", features = ["testing"] }
Expand Down Expand Up @@ -101,14 +102,16 @@ zerocopy = "0.7.31"
unsafe-libyaml = "0.2.10"
h2 = "0.4"

num-bigint = { version = "0.4" }

ethers = { version = "2.0.11" }

openssl = { version = "0.10", features = ["vendored"] }

parking_lot = "0.12.3"

# Dev dependencies
lazy_static = { version = "1.4.0" }
serial_test = "3.1.1"
hex = "0.4.3"
lazy_static = { version = "1.4.0" }

# Benchmarking
criterion = { version = "0.3.4", features = ["async_tokio"] }
2 changes: 1 addition & 1 deletion crates/starknet-devnet-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parking_lot = { workspace = true }
openssl = { workspace = true }

[dev-dependencies]
hex = "0.4.3"
hex = { workspace = true }

[features]
test_utils = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ impl JsonRpcHandler {
Ok(StarknetResponse::TransactionHash(TransactionHashOutput { transaction_hash }).into())
}

// devnet_impersonateAccount
/// devnet_impersonateAccount
pub async fn impersonate_account(&self, address: ContractAddress) -> StrictRpcResult {
let mut starknet = self.api.starknet.write().await;
starknet.impersonate_account(address)?;
Ok(super::JsonRpcResponse::Empty)
}

// devnet_stopImpersonatingAccount
/// devnet_stopImpersonatingAccount
pub async fn stop_impersonating_account(&self, address: ContractAddress) -> StrictRpcResult {
let mut starknet = self.api.starknet.write().await;
starknet.stop_impersonating_account(&address);
Ok(super::JsonRpcResponse::Empty)
}

// devnet_autoImpersonate | devnet_stopAutoImpersonate
/// devnet_autoImpersonate | devnet_stopAutoImpersonate
pub async fn set_auto_impersonate(&self, auto_impersonation: bool) -> StrictRpcResult {
let mut starknet = self.api.starknet.write().await;
starknet.set_auto_impersonate_account(auto_impersonation)?;
Expand Down
6 changes: 2 additions & 4 deletions crates/starknet-devnet-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ thiserror = { workspace = true }
starknet-rs-core = { workspace = true }
starknet-rs-crypto = { workspace = true }
serde = { workspace = true }
serde_json = { version = "1.0.81", features = [
serde_json = { workspace = true, features = [
"arbitrary_precision",
"preserve_order",
] }
starknet-rs-ff = { workspace = true }
num-integer = { version = "0.1.45", default-features = false }
num-bigint = { version = "0.4", features = ["serde"], default-features = false }
num-bigint = { workspace = true }
usc = { workspace = true }

# Cairo-lang dependencies
Expand All @@ -46,7 +45,6 @@ cairo-lang-utils = { workspace = true }

[package.metadata.cargo-machete]
ignored = [
"num-integer", # dependency of the types crate, but only re-exported
"cairo-lang-casm", # cannot publish without cairo-lang-*
"cairo-lang-compiler",
"cairo-lang-defs",
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet-devnet-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mod utils;

// Re export libraries
pub use rpc::{contract_address, contract_class, emitted_event, felt, messaging};
pub use {num_bigint, num_integer, starknet_api};
pub use {num_bigint, starknet_api};
2 changes: 1 addition & 1 deletion crates/starknet-devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ starknet-rs-accounts = { workspace = true }
axum = { workspace = true }
usc = { workspace = true }
reqwest = { workspace = true }
criterion = { version = "0.3.4", features = ["async_tokio"] }
criterion = { workspace = true }
serial_test = { workspace = true }


Expand Down
4 changes: 2 additions & 2 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ charset-normalizer==3.3.2
idna==3.7
numpy==1.26.4
psutil==5.9.8
requests==2.31.0
requests==2.32.0
scipy==1.13.0
urllib3==2.2.1
urllib3==2.2.2
26 changes: 13 additions & 13 deletions website/package-lock.json

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

0 comments on commit aefef84

Please sign in to comment.