scripted-diff: Rename `StatusLevel::{INFO,WARN,ERR}`
What changed, and why it matters
This is a straightforward code cleanup change that renames three internal status labels (INFO, WARN, ERR) to different capitalisation (Info, Warn, Error) because one of those names clashed with a system macro on illumos operating systems when running tests. It does not change program logic, user-facing behaviour, or security properties. It only prevents a possible build failure on an uncommon platform.
No security action required. Treat as a normal build-compatibility cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit performs a scripted rename of the StatusLevel enum members in src/qt/psbtoperationsdialog.h and all call sites in src/qt/psbtoperationsdialog.cpp. The rename avoids a conflict with the ERR macro defined in illumos’s regset.h when that header is pulled in via Boost.Test. The change is purely cosmetic/symbolic: no constants, control flow, or UI behaviour are altered.
Changed components
src/qt/psbtoperationsdialog.hsrc/qt/psbtoperationsdialog.cppInspect captured patch +24 / −24
diff --git a/src/qt/psbtoperationsdialog.cpp b/src/qt/psbtoperationsdialog.cpp
index 0a466d5a..9da2f755 100644
--- a/src/qt/psbtoperationsdialog.cpp
+++ b/src/qt/psbtoperationsdialog.cpp
@@ -63,7 +63,7 @@ void PSBTOperationsDialog::openWithPSBT(PartiallySignedTransaction psbtx)
if (err) {
showStatus(tr("Failed to load transaction: %1")
.arg(QString::fromStdString(PSBTErrorString(*err).translated)),
- StatusLevel::ERR);
+ StatusLevel::Error);
return;
}
m_ui->signTransactionButton->setEnabled(!complete && !m_wallet_model->wallet().privateKeysDisabled() && n_could_sign > 0);
@@ -87,22 +87,22 @@ void PSBTOperationsDialog::signTransaction()
if (err) {
showStatus(tr("Failed to sign transaction: %1")
- .arg(QString::fromStdString(PSBTErrorString(*err).translated)), StatusLevel::ERR);
+ .arg(QString::fromStdString(PSBTErrorString(*err).translated)), StatusLevel::Error);
return;
}
updateTransactionDisplay();
if (!complete && !ctx.isValid()) {
- showStatus(tr("Cannot sign inputs while wallet is locked."), StatusLevel::WARN);
+ showStatus(tr("Cannot sign inputs while wallet is locked."), StatusLevel::Warn);
} else if (!complete && n_signed < 1) {
- showStatus(tr("Could not sign any more inputs."), StatusLevel::WARN);
+ showStatus(tr("Could not sign any more inputs."), StatusLevel::Warn);
} else if (!complete) {
showStatus(tr("Signed %n input(s), but more signatures are still required.", "", n_signed),
- StatusLevel::INFO);
+ StatusLevel::Info);
} else {
showStatus(tr("Signed transaction successfully. Transaction is ready to broadcast."),
- StatusLevel::INFO);
+ StatusLevel::Info);
m_ui->broadcastTransactionButton->setEnabled(true);
}
}
@@ -113,7 +113,7 @@ void PSBTOperationsDialog::broadcastTransaction()
if (!FinalizeAndExtractPSBT(*m_transaction_data, mtx)) {
// This is never expected to fail unless we were given a malformed PSBT
// (e.g. with an invalid signature.)
- showStatus(tr("Unknown error processing transaction."), StatusLevel::ERR);
+ showStatus(tr("Unknown error processing transaction."), StatusLevel::Error);
return;
}
@@ -124,10 +124,10 @@ void PSBTOperationsDialog::broadcastTransaction()
if (error == TransactionError::OK) {
showStatus(tr("Transaction broadcast successfully! Transaction ID: %1")
- .arg(QString::fromStdString(tx->GetHash().GetHex())), StatusLevel::INFO);
+ .arg(QString::fromStdString(tx->GetHash().GetHex())), StatusLevel::Info);
} else {
showStatus(tr("Transaction broadcast failed: %1")
- .arg(QString::fromStdString(TransactionErrorString(error).translated)), StatusLevel::ERR);
+ .arg(QString::fromStdString(TransactionErrorString(error).translated)), StatusLevel::Error);
}
}
@@ -135,7 +135,7 @@ void PSBTOperationsDialog::copyToClipboard() {
DataStream ssTx{};
ssTx << *m_transaction_data;
GUIUtil::setClipboard(EncodeBase64(ssTx.str()).c_str());
- showStatus(tr("PSBT copied to clipboard."), StatusLevel::INFO);
+ showStatus(tr("PSBT copied to clipboard."), StatusLevel::Info);
}
void PSBTOperationsDialog::saveTransaction() {
@@ -167,7 +167,7 @@ void PSBTOperationsDialog::saveTransaction() {
std::ofstream out{filename.toLocal8Bit().data(), std::ofstream::out | std::ofstream::binary};
out << ssTx.str();
out.close();
- showStatus(tr("PSBT saved to disk."), StatusLevel::INFO);
+ showStatus(tr("PSBT saved to disk."), StatusLevel::Info);
}
void PSBTOperationsDialog::updateTransactionDisplay() {
@@ -228,15 +228,15 @@ QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction
void PSBTOperationsDialog::showStatus(const QString &msg, StatusLevel level) {
m_ui->statusBar->setText(msg);
switch (level) {
- case StatusLevel::INFO: {
+ case StatusLevel::Info: {
m_ui->statusBar->setStyleSheet("QLabel { background-color : lightgreen }");
break;
}
- case StatusLevel::WARN: {
+ case StatusLevel::Warn: {
m_ui->statusBar->setStyleSheet("QLabel { background-color : orange }");
break;
}
- case StatusLevel::ERR: {
+ case StatusLevel::Error: {
m_ui->statusBar->setStyleSheet("QLabel { background-color : red }");
break;
}
@@ -265,32 +265,32 @@ void PSBTOperationsDialog::showTransactionStatus(const PartiallySignedTransactio
switch (analysis.next) {
case PSBTRole::UPDATER: {
- showStatus(tr("Transaction is missing some information about inputs."), StatusLevel::WARN);
+ showStatus(tr("Transaction is missing some information about inputs."), StatusLevel::Warn);
break;
}
case PSBTRole::SIGNER: {
QString need_sig_text = tr("Transaction still needs signature(s).");
- StatusLevel level = StatusLevel::INFO;
+ StatusLevel level = StatusLevel::Info;
if (!m_wallet_model) {
need_sig_text += " " + tr("(But no wallet is loaded.)");
- level = StatusLevel::WARN;
+ level = StatusLevel::Warn;
} else if (m_wallet_model->wallet().privateKeysDisabled()) {
need_sig_text += " " + tr("(But this wallet cannot sign transactions.)");
- level = StatusLevel::WARN;
+ level = StatusLevel::Warn;
} else if (n_could_sign < 1) {
need_sig_text += " " + tr("(But this wallet does not have the right keys.)"); // XXX wording
- level = StatusLevel::WARN;
+ level = StatusLevel::Warn;
}
showStatus(need_sig_text, level);
break;
}
case PSBTRole::FINALIZER:
case PSBTRole::EXTRACTOR: {
- showStatus(tr("Transaction is fully signed and ready for broadcast."), StatusLevel::INFO);
+ showStatus(tr("Transaction is fully signed and ready for broadcast."), StatusLevel::Info);
break;
}
default: {
- showStatus(tr("Transaction status is unknown."), StatusLevel::ERR);
+ showStatus(tr("Transaction status is unknown."), StatusLevel::Error);
break;
}
}
diff --git a/src/qt/psbtoperationsdialog.h b/src/qt/psbtoperationsdialog.h
index be2b7425..fb6ed685 100644
--- a/src/qt/psbtoperationsdialog.h
+++ b/src/qt/psbtoperationsdialog.h
@@ -40,9 +40,9 @@ private:
ClientModel* m_client_model;
enum class StatusLevel {
- INFO,
- WARN,
- ERR
+ Info,
+ Warn,
+ Error
};
size_t couldSignInputs(const PartiallySignedTransaction &psbtx);
Why this scored 17/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.