nakamoto-test 0.1.0

Testing utilities for nakamoto crates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use nakamoto_common::block::BlockHeader;
pub use nakamoto_common::block::*;

pub mod cache {
    pub mod model;
}

/// Solve a block's proof of work puzzle.
pub fn solve(header: &mut BlockHeader) {
    let target = header.target();
    while header.validate_pow(&target).is_err() {
        header.nonce += 1;
    }
}