-
Notifications
You must be signed in to change notification settings - Fork 317
rpcconsole: display signet challenge #896
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
base: master
Are you sure you want to change the base?
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. 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. |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)
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.
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) |
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.
squash later
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a global constant?
} | ||
|
||
// Provide the full challenge when Copy&Paste | ||
QMimeData* createMimeDataFromSelection() const { |
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.
the full challenge should be copy and pasted - please test
cc: @luke-jr @pablomartin4btc
f358239
to
f4bc05a
Compare
use HexStr() per pablomartin4btc suggestion |
7d81eb3
to
f9e77ca
Compare
c5b9f67
to
0496ce5
Compare
rebase on top of gui/master temporarily cherry-pick PR bitcoin/bitcoin#33480 to fix an issue. |
No description provided.