This extracts the `difficulty` module from `block` and the `equihash_solution` module from the crate root. The PoW calculations are significantly more complicated than the other block code and pretty dissimilar from it, so it makes more sense to create a common proof of work module. The `EquihashSolution` and `EQUIHASH_SOLUTION_SIZE` are renamed to `equihash::Solution` and `equihash::SOLUTION_SIZE` and imported that way, except in `block/header.rs`, to avoid a conflict with the `equihash` crate. In the future it would be better to encapsulate the equihash solution check into the `equihash::Solution` type so that callers only need to import our `work::equihash`. The test organization leaves a little to be desired but I think that this can be improved as we fill out the proof of work implementation. |
||
|---|---|---|
| .. | ||
| proptest-regressions | ||
| src | ||
| Cargo.toml | ||