-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change(chain): Refactor the handling of height differences (#6330)
* Unify the `impl`s of `Sub` and `Add` for `Height` * Adjust tests for `Height` subtraction * Use `Height` instead of `i32` * Use `block:Height` in RPC tests * Use `let .. else` statement Co-authored-by: Arya <[email protected]> * Update zebra-consensus/src/block/subsidy/general.rs * Refactor the handling of height differences * Remove a redundant comment * Update zebrad/src/components/sync/progress.rs Co-authored-by: Arya <[email protected]> * Update progress.rs * impl TryFrom<u32> for Height * Make some test assertions clearer * Refactor estimate_up_to() * Restore a comment that was accidentally removed * Document when estimate_distance_to_network_chain_tip() returns None * Change HeightDiff to i64 and make Height.sub(Height) return HeightDiff (no Option) * Update chain tip estimates for HeightDiff i64 * Update subsidy for HeightDiff i64 * Fix some height calculation test edge cases * Fix the funding stream interval calculation --------- Co-authored-by: Arya <[email protected]> Co-authored-by: teor <[email protected]>
- Loading branch information
1 parent
6a65df1
commit 2a48d4c
Showing
20 changed files
with
274 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.