()
| 924 | #[test] |
| 925 | #[should_panic(expected = "Hash is not valid")] |
| 926 | fn test_hash_check_fail() { |
| 927 | let block_headers = BLOCK_HEADERS |
| 928 | .iter() |
| 929 | .map(|header| CircuitBlockHeader::try_from_slice(header).unwrap()) |
| 930 | .collect::<Vec<CircuitBlockHeader>>(); |
| 931 | |
| 932 | let first_15_hashes = block_headers[..15] |
| 933 | .iter() |
| 934 | .map(|header| header.compute_block_hash()) |
| 935 | .collect::<Vec<[u8; 32]>>(); |
| 936 | |
| 937 | // The validation is expected to panic |
| 938 | check_hash_valid( |
| 939 | &first_15_hashes[0], |
| 940 | &U256::from_be_hex("00000000FFFF0000000000000000000000000000000000000000000000000000") |
| 941 | .wrapping_div(&(U256::ONE << 157)) |
| 942 | .to_be_bytes(), |
| 943 | ); |
| 944 | } |
| 945 | |
| 946 | #[test] |
| 947 | fn test_hash_check_pass() { |
nothing calls this directly
no test coverage detected