-
Notifications
You must be signed in to change notification settings - Fork 37.7k
refactor: Pass ArgsManager into functions that register args #19561
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
@@ -341,8 +341,8 @@ class CRegTestParams : public CChainParams { | |||
|
|||
void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args) | |||
{ | |||
if (gArgs.IsArgSet("-segwitheight")) { | |||
int64_t height = gArgs.GetArg("-segwitheight", consensus.SegwitHeight); | |||
if (args.IsArgSet("-segwitheight")) { |
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 line had been added when local args
already existed. I couldn't find any reason for the use of global variable, but maybe I'm missing something.
scripted diffs shouldn't modify out-of-git-tree files. Please replace the wildcard; See other scripted diffs for examples. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK, apart from my feedback ofc |
Updated scripted diff to avoid touching out-of-tree files |
-BEGIN VERIFY SCRIPT- sed -i -e 's/gArgs.Add/argsman.Add/g' `git grep -l "gArgs.Add"` -END VERIFY SCRIPT-
ACK 8ed9002 👛 Show signature and timestampSignature:
Timestamp of file with hash |
Summary: ``` Rationale: reduce use of gArgs to decouple code and simplify future maintenance and easier unit testing. This PR is continuation of work started in #18926 and #18662 It covers only places that register args in ArgsManager with AddArgs() or AddHiddenArgs(). ``` Backport of core [[bitcoin/bitcoin#19561 | PR19561]]. Depends on D8643. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D8644
Rationale: reduce use of gArgs to decouple code and simplify future maintenance and easier unit testing.
This PR is continuation of work started in #18926 and #18662
It covers only places that register args in ArgsManager with
AddArgs()
orAddHiddenArgs()
.Closes #19511