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

Function test_bits_to_target

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

Source from the content-addressed store, hash-verified

971
972 #[test]
973 fn test_bits_to_target() {
974 // https://learnmeabitcoin.com/explorer/block/00000000000000000002ebe388cb8fa0683fc34984cfc2d7d3b3f99bc0d51bfd
975 let expected_target =
976 hex!("00000000000000000002f1280000000000000000000000000000000000000000");
977 let bits: u32 = 0x1702f128;
978 let target = bits_to_target(bits);
979 assert_eq!(target, expected_target);
980
981 let converted_bits = target_to_bits(&target);
982
983 assert_eq!(converted_bits, bits);
984 }
985
986 #[test]
987 fn test_difficulty_adjustments() {

Callers

nothing calls this directly

Calls 2

bits_to_targetFunction · 0.85
target_to_bitsFunction · 0.85

Tested by

no test coverage detected