Skip to content

Commit

Permalink
chore: generalize contract class from file test util
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Jul 17, 2024
1 parent 3d98805 commit da33b52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/starknet_sierra_compile/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ struct DeserializedContractClass {
pub entry_points_by_type: ContractEntryPoints,
}

pub(crate) fn contract_class_from_file(file: &Path) -> ContractClass {
pub(crate) fn contract_class_from_file<P: AsRef<Path>>(path: P) -> ContractClass {
let DeserializedContractClass {
sierra_program,
sierra_program_debug_info,
contract_class_version,
entry_points_by_type,
} = serde_json::from_str(&fs::read_to_string(file).expect("Failed to read input file."))
} = serde_json::from_str(&fs::read_to_string(path).expect("Failed to read input file."))
.expect("deserialization Failed.");

ContractClass {
Expand Down

0 comments on commit da33b52

Please sign in to comment.