qt: Added test coverage for qt gui#901 console history filter
What changed, and why it matters
This commit only adds new automated test cases for the Bitcoin Core Qt console's command-history filtering feature. It checks that sensitive wallet commands (like createwallet and migratewallet) are displayed in shortened form in the console history. There is no change to production code and no security fix or vulnerability.
No action required; this is a benign test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff extends RPCNestedTests::rpcNestedTests() in src/qt/test/rpcnestedtests.cpp with three additional QVERIFY assertions verifying that RPCConsole::RPCParseCommandLine masks createwallet, createwalletdescriptor, and migratewallet arguments as ‘(…)’ in the filtered console history string. It also updates the copyright year range to ‘2016-present’. No runtime code is modified.
Changed components
src/qt/test/rpcnestedtests.cppInspect captured patch +7 / −1
diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp
index 0857a4eb..18f4fc1e 100644
--- a/src/qt/test/rpcnestedtests.cpp
+++ b/src/qt/test/rpcnestedtests.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2021 The Bitcoin Core developers
+// Copyright (c) 2016-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -85,6 +85,12 @@ void RPCNestedTests::rpcNestedTests()
QVERIFY(result == "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b");
QVERIFY(filtered == "getblock(getbestblockhash())[tx][0]");
+ RPCConsole::RPCParseCommandLine(nullptr, result, "createwallet test true", false, &filtered);
+ QVERIFY(filtered == "createwallet(…)");
+ RPCConsole::RPCParseCommandLine(nullptr, result, "createwalletdescriptor abc", false, &filtered);
+ QVERIFY(filtered == "createwalletdescriptor(…)");
+ RPCConsole::RPCParseCommandLine(nullptr, result, "migratewallet abc abc", false, &filtered);
+ QVERIFY(filtered == "migratewallet(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "signmessagewithprivkey abc", false, &filtered);
QVERIFY(filtered == "signmessagewithprivkey(…)");
RPCConsole::RPCParseCommandLine(nullptr, result, "signmessagewithprivkey abc,def", false, &filtered);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.