-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: Use ChainType enum exhaustively #27611
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
Can remove |
Do you mean these TheCharlatan@0e7abdc ? |
I mean the ones of the touched methods |
Example: diff --git a/src/chainparams.h b/src/chainparams.h
index 6a65f40f80..23b272cc41 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -26,7 +26,6 @@ class ArgsManager;
/**
* Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
* @returns a CChainParams* of the chosen chain.
- * @throws a std::runtime_error if the chain is not supported.
*/
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const ChainType chain);
@@ -38,7 +37,6 @@ const CChainParams &Params();
/**
* Sets the params returned by Params() to those for the given chain name.
- * @throws std::runtime_error when the chain is not supported.
*/
void SelectParams(const ChainType chain);
|
d0767a9
to
ef39bdf
Compare
Updated d0767a9 -> ef39bdf (followUp27491_0 -> followUp27491_1, compare)
|
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.
lgtm, found another nit, feel free to ignore
This is a follow up of bitcoin#27491, more concretely bitcoin#27491 (comment), for not using default cases (as per the style guide), and bitcoin#27491 (comment) and bitcoin#27491 (comment) for avoiding dead code. Also change chain name to chain type in docstrings
ef39bdf
to
e230887
Compare
Updated ef39bdf -> e230887 (followUp27491_1 -> followUp27491_2, compare)
|
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.
lgtm
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.
Concept ACK. |
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.
Post-merge ACK e230887.
return ""; | ||
} | ||
assert(false); |
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.
Our Developer Notes also suggest a comment // no default case, so the compiler can warn about missing cases
.
e230887 refactor: Use ChainType enum exhaustively (TheCharlatan) Pull request description: This is a follow up of bitcoin#27491, more concretely bitcoin#27491 (comment), for not using default cases (as per the style guide), and bitcoin#27491 (comment) and bitcoin#27491 (comment) for avoiding dead code. ACKs for top commit: fanquake: ACK e230887 - deals with almost all follow up comments out of bitcoin#27491. Tree-SHA512: 1794190b03b91d3ca349a4da08e9610dbb3432983eee7cb21ecc758d1d7d710560c97661de14cdf493c28c00ebe8977511b4696055c0940e7f815b622dbacd16
This is a follow up of #27491, more concretely #27491 (comment), for not using default cases (as per the style guide), and #27491 (comment) and #27491 (comment) for avoiding dead code.