Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set empty relative_path #495

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/mempool_test_utils/src/starknet_api_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ pub fn executable_resource_bounds_mapping() -> ResourceBoundsMapping {

/// Get the contract class used for testing.
pub fn contract_class() -> ContractClass {
env::set_current_dir(get_absolute_path(TEST_FILES_FOLDER)).expect("Couldn't set working dir.");
let json_file_path = Path::new(CONTRACT_CLASS_FILE);
env::set_current_dir(get_absolute_path("")).expect("Couldn't set working dir.");
let json_file_path = Path::new(TEST_FILES_FOLDER).join(CONTRACT_CLASS_FILE);
serde_json::from_reader(File::open(json_file_path).unwrap()).unwrap()
}

Expand Down
8 changes: 4 additions & 4 deletions crates/starknet_sierra_compile/src/compile_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::test_utils::contract_class_from_file;

#[test]
fn test_compile_sierra_to_casm() {
env::set_current_dir(get_absolute_path(TEST_FILES_FOLDER)).expect("Failed to set current dir.");
let sierra_path = Path::new(FAULTY_ACCOUNT_CLASS_FILE);
env::set_current_dir(get_absolute_path("")).expect("Failed to set current dir.");
let sierra_path = Path::new(TEST_FILES_FOLDER).join(FAULTY_ACCOUNT_CLASS_FILE);
let expected_casm_contract_length = 72304;

let contract_class = contract_class_from_file(sierra_path);
Expand All @@ -24,8 +24,8 @@ fn test_compile_sierra_to_casm() {
// TODO(Arni, 1/5/2024): Add a test for panic result test.
#[test]
fn test_negative_flow_compile_sierra_to_casm() {
env::set_current_dir(get_absolute_path(TEST_FILES_FOLDER)).expect("Failed to set current dir.");
let sierra_path = Path::new(FAULTY_ACCOUNT_CLASS_FILE);
env::set_current_dir(get_absolute_path("")).expect("Failed to set current dir.");
let sierra_path = Path::new(TEST_FILES_FOLDER).join(FAULTY_ACCOUNT_CLASS_FILE);

let mut contract_class = contract_class_from_file(sierra_path);
// Truncate the sierra program to trigger an error.
Expand Down
Loading