Skip to content

Commit

Permalink
chore: set empty relative_path
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Jul 23, 2024
1 parent fc5813a commit 71013e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 71013e9

Please sign in to comment.