MCPcopy Create free account
hub / github.com/BitVM/BitVM / test_15_block_hash_calculation

Function test_15_block_hash_calculation

header-chain/src/header_chain.rs:862–873  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

860
861 #[test]
862 fn test_15_block_hash_calculation() {
863 let block_headers = BLOCK_HEADERS
864 .iter()
865 .map(|header| CircuitBlockHeader::try_from_slice(header).unwrap())
866 .collect::<Vec<CircuitBlockHeader>>();
867
868 for i in 0..block_headers.len() - 1 {
869 let block_hash = block_headers[i].compute_block_hash();
870 let next_block = &block_headers[i + 1];
871 assert_eq!(block_hash, next_block.prev_block_hash);
872 }
873 }
874
875 #[test]
876 fn test_median() {

Callers

nothing calls this directly

Calls 2

lenMethod · 0.80
compute_block_hashMethod · 0.80

Tested by

no test coverage detected