(target: &[u8; 32])
| 353 | } |
| 354 | |
| 355 | fn calculate_work(target: &[u8; 32]) -> U256 { |
| 356 | let target = U256::from_be_slice(target); |
| 357 | let target_plus_one = target.saturating_add(&U256::ONE); |
| 358 | let work = U256::MAX.wrapping_div(&target_plus_one); |
| 359 | work |
| 360 | } |
| 361 | |
| 362 | /// The output of the header chain circuit. |
| 363 | #[derive(Serialize, Deserialize, Eq, PartialEq, Clone, Debug, BorshDeserialize, BorshSerialize)] |