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

Function calculate_work

header-chain/src/header_chain.rs:355–360  ·  view source on GitHub ↗
(target: &[u8; 32])

Source from the content-addressed store, hash-verified

353}
354
355fn 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)]

Callers 1

apply_blocksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected