Skip to content
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

[Qt] Console: allow empty arguments #9329

Merged
merged 3 commits into from Dec 19, 2016

Conversation

jonasschnelli
Copy link
Contributor

Should fix #9210 and re-allow empty arguments like command '' <more arg...> or command "" <more args...>.

@luke-jr
Copy link
Member

luke-jr commented Dec 12, 2016

Maybe add a unit test to check this case?

@luke-jr
Copy link
Member

luke-jr commented Dec 12, 2016

This doesn't appear to actually fix the problem at all: luke-jr@3710cf3

@jonasschnelli
Copy link
Contributor Author

Added @luke-jr's unit test, added some more fixes.

@luke-jr
Copy link
Member

luke-jr commented Dec 13, 2016

Here's a few more, including one that fails:

    RPCConsole::RPCExecuteCommandLine(result, "rpcNestedTest(abc,,abc)");
    QVERIFY(result == "[\"abc\",\"\",\"abc\"]");
    RPCConsole::RPCExecuteCommandLine(result, "rpcNestedTest(abc,,)");  // this one fails
    QVERIFY(result == "[\"abc\",\"\",\"\"]");
    RPCConsole::RPCExecuteCommandLine(result, "rpcNestedTest(abc )");
    QVERIFY(result == "[\"abc\"]");
    RPCConsole::RPCExecuteCommandLine(result, "rpcNestedTest( abc)");
    QVERIFY(result == "[\"abc\"]");

@jonasschnelli
Copy link
Contributor Author

Added more rules and tests.
Now, empty arguments are no longer supported when using the comma-syntax.
Examples

  • [NOK] command <arg0>,,<arg2>
  • [OK] command <arg0>,"",<arg2>
  • [NOK] command(<arg0>,,<arg2>)
  • [NOK] command(<arg0>,)
  • [OK] command <arg0> "" <arg2>
  • [OK] command( <arg0> , <arg2> )

@laanwj
Copy link
Member

laanwj commented Dec 15, 2016

Now, empty arguments are no longer supported when using the comma-syntax.

Makes sense, I think.
Thanks for adding tests :)
code-review-ACK 413ce40

@laanwj laanwj self-requested a review December 15, 2016 16:08
@laanwj laanwj merged commit 390bd14 into bitcoin:master Dec 19, 2016
laanwj added a commit that referenced this pull request Dec 19, 2016
390bd14 [Qt] Console: don't allow empty arguments when using the comma-syntax (Jonas Schnelli)
6a32c0f Qt/Test: Check handling of empty arguments in RPC debug console (Luke Dashjr)
89c8d2c [Qt] Console: allow empty arguments (Jonas Schnelli)
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Dec 21, 2016
luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Dec 21, 2016
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Dec 21, 2016
codablock pushed a commit to codablock/dash that referenced this pull request Jan 18, 2018
390bd14 [Qt] Console: don't allow empty arguments when using the comma-syntax (Jonas Schnelli)
6a32c0f Qt/Test: Check handling of empty arguments in RPC debug console (Luke Dashjr)
89c8d2c [Qt] Console: allow empty arguments (Jonas Schnelli)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
390bd14 [Qt] Console: don't allow empty arguments when using the comma-syntax (Jonas Schnelli)
6a32c0f Qt/Test: Check handling of empty arguments in RPC debug console (Luke Dashjr)
89c8d2c [Qt] Console: allow empty arguments (Jonas Schnelli)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 26, 2019
390bd14 [Qt] Console: don't allow empty arguments when using the comma-syntax (Jonas Schnelli)
6a32c0f Qt/Test: Check handling of empty arguments in RPC debug console (Luke Dashjr)
89c8d2c [Qt] Console: allow empty arguments (Jonas Schnelli)
furszy added a commit to PIVX-Project/PIVX that referenced this pull request Aug 19, 2021
47607df [Qt] Console: don't allow empty arguments when using the comma-syntax (random-zebra)
af215ef [Qt] Console: allow empty arguments (random-zebra)

Pull request description:

  #2372 broke the support for empty arguments `""` (which is required as first argument of `sendmany`).
  Backport the fix from bitcoin#9329

  Thanks to @NoobieDev12 for reporting this bug.

ACKs for top commit:
  furszy:
    Nice catch👌, ACK 47607df
  Fuzzbawls:
    ACK 47607df

Tree-SHA512: 9ebcce3fbcb10856fc0a586365a9f0c4a3bbed5df571f21b37a143a882ab937b0fdf0502d1ba39e015cc0f745b07ed78fa8eb547110d0e53401f0d88af89cba1
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sendmany no longer works over the GUI
3 participants