Expand description
Helper utilities
Statics§
- MAX_
32_ BYTES - Max 32 bytes integer, used in rank calculations. Cached to avoid repeated allocation.
Functions§
- best_
fork_ index - Auxiliary function to find best ranked fork.
- block_
rank - Compute a block’s rank, assuming that its valid, based on provided mining target.
- deploy_
native_ contracts - Deploy DarkFi native wasm contracts to provided blockchain overlay.
- find_
extended_ fork_ index - Given a proposal, find the index of a fork chain it extends, along with the specific extended proposal index. Additionally, check that proposal doesn’t already exists in any fork chain.
- get_mid
- Auxiliary function to calculate the middle value between provided u64 numbers.
- header_
rank - Verify provided header is valid for provided PoW module and compute its rank. Returns next mine difficulty, along with the computed rank.
- median
- Auxiliary function to calculate the median of a given
Vec<u64>. The function sorts the vector internally. - worst_
fork_ index - Auxiliary function to find worst ranked fork.