rpcconsole: display signet challenge#896
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsNo conflicts as of last run. |
|
cc @Sjors |
src/qt/rpcconsole.cpp
Outdated
| std::string challenge_end = challengeString.substr(challengeString.length() - 8); | ||
|
|
||
| ui->networkName->setText( | ||
| tr("Signet: (%1...%2)").arg( |
There was a problem hiding this comment.
Might be a better way to elide the middle so that a copy/paste gets the full string?
There was a problem hiding this comment.
Testing a proper Qt interface for better formatting now.
src/util/strencodings.cpp
Outdated
| return str; | ||
| } | ||
|
|
||
| std::string ChallengeToStdString(const std::vector<uint8_t>& v) |
There was a problem hiding this comment.
move ChallengeToStdString to src/util/strencodings.cpp for later availability in main window.
src/qt/rpcconsole.cpp
Outdated
| return QWidget::eventFilter(obj, event); | ||
| } | ||
|
|
||
| std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v) |
There was a problem hiding this comment.
removed std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)
There was a problem hiding this comment.
It would be good to put the label "challenge:" in both the info tab and the title, and also differentiate between the default challenge and the custom one (specified by -signetchallenge=). With this in mind perhaps when there's no custom challenge specified we don't update the window title but only the info tab ("Name: Signet (challenge: 512103ad...e6c452ae, default)" or something like that).
For the conversion you can use HexStr() instead of ChallengeToStdString().
i was thinking a long the same lines. I will test against bitcoin/bitcoin#29838 and make a decision - trying to avoid a conflict. :) |
|
also trying to treat the challenge as a fingerprint - avoiding clutter in the title but the rcpconsole formatting ought to look ok. |
d166b3b to
5f06fbb
Compare
|
fixed typo and commit scope |
src/qt/rpcconsole.cpp
Outdated
| return QWidget::eventFilter(obj, event); | ||
| } | ||
|
|
||
| std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v) |
src/qt/rpcconsole.h
Outdated
| virtual bool eventFilter(QObject* obj, QEvent *event) override; | ||
| void keyPressEvent(QKeyEvent *) override; | ||
| void changeEvent(QEvent* e) override; | ||
| std::string challengeToString(const std::vector<uint8_t>& v); |
There was a problem hiding this comment.
squash later
src/qt/rpcconsole.cpp
Outdated
| const char fontSizeSettingsKey[] = "consoleFontSize"; | ||
|
|
||
| const std::string DEFAULT_CHALLENGE_STRING = | ||
| "512103AD5E0EDAD18CB1F0FC0D28A3D4F1F3E445640337489ABB10404F2D1E086BE430210359EF5021964FE22D6F8E05B2463C9540CE96883FE3B278760F048F5189F2E6C452AE"; |
There was a problem hiding this comment.
maybe a global constant?
| } | ||
|
|
||
| // Provide the full challenge when Copy&Paste | ||
| QMimeData* createMimeDataFromSelection() const { |
There was a problem hiding this comment.
the full challenge should be copy and pasted - please test
cc: @luke-jr @pablomartin4btc
f358239 to
f4bc05a
Compare
|
use HexStr() per pablomartin4btc suggestion |
c5b9f67 to
0496ce5
Compare
|
rebase on top of gui/master temporarily cherry-pick PR bitcoin/bitcoin#33480 to fix an issue. |
0496ce5 to
db1c408
Compare
|
The PR description is currently empty. Could you please add the motivation for this change, along with a few example use cases? |







Motivation:
This pull request aims to enhance the RPC console by displaying the signet challenge, providing users with crucial network configuration information directly within the console. This improves usability and clarity, especially for users interacting with custom signet networks.
Use Cases:
Verifying Signet Configuration: Users can quickly verify the active signet challenge when connecting to a custom signet, ensuring they are on the intended network.
Improved User Experience: For developers and advanced users working with multiple signet environments, having the challenge readily visible in the RPC console reduces the need to look up configuration details elsewhere.