-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change(consensus): Refactor production code for network consensus rules to Network
methods
#8340
Conversation
Squashed from multiple commits to enable partial rebase
…arameters on zcash Network where possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Network
methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still looks good, I left a few comments for minor doc cleanups, none of them are blockers.
I thought the conversion from Network
to Magic
was duplicated for a moment, but it was just a confusing diff.
Network
methodsNetwork
methods
@Mergifyio refresh |
✅ Pull request refreshed |
Supercedes: #8297
Step 2 of: #7968 (comment)
Closes #8326.
Motivation
The goal of this PR is to factor code into zebra-chain::parameters::network::Network.
This will encapsulate network-variant specific behavior behind methods that are implemented on the Network enum.
Developers can then depend on methods like:
activation_height
returning the appropriate values for the Network they are using.This convenience can then be extended to more types of networks like custom testnets with mainnet parameters, or parameters that are different from either mainnet or testnet (e.g. the "regtest" case).
PR Author Checklist
Check before marking the PR as ready for review:
For significant changes:
- [ ] Can these changes be split into multiple PRs?If a checkbox isn't relevant to the PR, mark it as done.
Specifications
Complex Code or Requirements
Solution
Testing
Review
Reviewer Checklist
Check before approving the PR:
PR blockers can be dealt with in new tickets or PRs.
And check the PR Author checklist is complete.
Follow Up Work
Minor cleanups