rust-bitcoin-unsafe-fast/bitcoin
Tobin C. Harding cb9893c4a9 Add Target and Difficulty types
Currently we use the `Uint256` type to represent two proof of work
integers, namely target and difficulty (work).

It would be nice to not have a public integer type that is not fully
implemented (i.e., does not implement arithmetic etc as do integer types
in stdlib). Instead of implementing all the stdlib functions we can
instead add two new wrapper types, since these are not general purpose
integers they do not need to implement anything we do not need to use.

- Add a `pow` module.
- Put a modified version of `Uint256` to `pow`.
- Add two new wrapper types `Target` and `Difficulty`.
- Only implement methods that we use on each type.

Note this patch does not remove the original `Uint256`, that will be
done as a separate patch.
2022-09-28 04:16:59 +10:00
..
contrib Add a workspace to the top level directory. 2022-09-13 08:44:57 +10:00
examples Try to fix up sighash export mess 2022-09-19 16:46:02 +10:00
src Add Target and Difficulty types 2022-09-28 04:16:59 +10:00
test_data Add a workspace to the top level directory. 2022-09-13 08:44:57 +10:00
Cargo.toml Fix serde versions 2022-09-13 16:19:07 +02:00