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
cli: Reject arguments to -getinfo #11710
Conversation
Travis failure:
|
Strange! Seems a legit error. Will look at it. Ah, yes, the test seems to test something that should be failing:
Will execute
Which makes no sense :) Will update the test. |
Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trialing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`.
cd537d6
to
dcfef27
Compare
Updated the test, now it tests both cases correctly, travis issue should be solved. |
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.
utACK dcfef27.
@@ -35,8 +35,11 @@ def run_test(self): | |||
assert_equal(["foo", "bar"], self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input=password + "\nfoo\nbar").echo()) | |||
assert_raises_process_error(1, "incorrect rpcuser or rpcpassword", self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input="foo").echo) | |||
|
|||
self.log.info("Make sure that -getinfo with arguments fails") | |||
assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help) |
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.
👍
Tested ACK dcfef27 |
utACK dcfef27 |
utACK dcfef27 |
dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4
Summary: dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4 Backport of Core PR11710 bitcoin/bitcoin#11710 Please note, this is `./bitcoin-cli -getinfo`, NOT the deprecated/removed RPC call. Test Plan: make check test_runner.py Reviewers: jasonbcox, deadalnix, Fabien, O1 Bitcoin ABC, #bitcoin_abc, markblundeberg Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, markblundeberg Subscribers: markblundeberg Differential Revision: https://reviews.bitcoinabc.org/D3229
Summary: dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4 Backport of Core PR11710 bitcoin/bitcoin#11710 Please note, this is `./bitcoin-cli -getinfo`, NOT the deprecated/removed RPC call. Test Plan: make check test_runner.py Reviewers: jasonbcox, deadalnix, Fabien, O1 Bitcoin ABC, #bitcoin_abc, markblundeberg Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, markblundeberg Subscribers: markblundeberg Differential Revision: https://reviews.bitcoinabc.org/D3229
dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4
dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4
dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4
dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan) Pull request description: Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trailing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`. Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4
Currently it's possible to accidentally type e.g.
and get an answer which can be confusing; the trailing arguments are just ignored.
To avoid this, throw an error if the user provides arguments to
-getinfo
.