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

Commit

Permalink
Adds tests related to class hash: (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoPittella authored Jul 10, 2023
1 parent 87be4f0 commit a54c320
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
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.

0 comments on commit a54c320

Please # to comment.