Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Adds tests related to class hash: #801

Merged
merged 1 commit into from
Jul 10, 2023
Merged
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
32 changes: 32 additions & 0 deletions src/core/contract_address/deprecated_contract_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,36 @@ mod tests {
)
);
}

#[test]
fn test_compute_class_hash_0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f_mainnet(
) {
let contract_class = ContractClass::from_path(
"starknet_programs/raw_contract_classes/0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f_mainnet.json"
).unwrap();

assert_eq!(
compute_deprecated_class_hash(&contract_class).unwrap(),
felt_str!(
"4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f",
16
)
);
}

#[test]
fn test_compute_class_hash_0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f_goerli(
) {
let contract_class = ContractClass::from_path(
"starknet_programs/raw_contract_classes/0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f_goerli.json"
).unwrap();

assert_eq!(
compute_deprecated_class_hash(&contract_class).unwrap(),
felt_str!(
"4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f",
16
)
);
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.