()
| 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() { |
nothing calls this directly
no test coverage detected