Skip to content

Commit

Permalink
chore(starknet_api): use infra_util current_dir fn
Browse files Browse the repository at this point in the history
commit-id:6fd8e685
  • Loading branch information
Itay-Tsabary-Starkware committed Dec 10, 2024
1 parent 1b7c0c9 commit b016742
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions crates/starknet_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license-file.workspace = true
description = "Starknet Rust types related to computation and execution."

[features]
testing = []
testing = ["infra_utils"]

[dependencies]
bitvec.workspace = true
Expand All @@ -16,6 +16,7 @@ cairo-lang-starknet-classes.workspace = true
derive_more.workspace = true
hex.workspace = true
indexmap = { workspace = true, features = ["serde"] }
infra_utils = { workspace = true, optional = true }
itertools.workspace = true
num-bigint.workspace = true
pretty_assertions.workspace = true
Expand All @@ -33,7 +34,7 @@ thiserror.workspace = true
[dev-dependencies]
assert_matches.workspace = true
rstest.workspace = true

starknet_api = { workspace = true, features = ["testing"] }

[lints]
workspace = true
3 changes: 2 additions & 1 deletion crates/starknet_api/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::collections::HashMap;
use std::fs::read_to_string;
use std::path::{Path, PathBuf};

use infra_utils::path::current_dir;
use serde::{Deserialize, Serialize};
use serde_json::to_string_pretty;
use starknet_types_core::felt::Felt;
Expand All @@ -20,7 +21,7 @@ pub mod l1_handler;
/// directory has a `resources` folder. The value for file_path should be the path to the required
/// file in the folder "resources".
pub fn path_in_resources<P: AsRef<Path>>(file_path: P) -> PathBuf {
std::env::current_dir().unwrap().join("resources").join(file_path)
current_dir().unwrap().join("resources").join(file_path)
}

/// Reads from the directory containing the manifest at run time, same as current working directory.
Expand Down

0 comments on commit b016742

Please sign in to comment.