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

Transaction large error message change #1438

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/qt/bitcoinstrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ QT_TRANSLATE_NOOP("firo-core", "Transaction has too long of a mempool chain"),
QT_TRANSLATE_NOOP("firo-core", "Transaction must have at least one recipient"),
QT_TRANSLATE_NOOP("firo-core", "Transaction not valid."),
QT_TRANSLATE_NOOP("firo-core", "Transaction too large for fee policy"),
QT_TRANSLATE_NOOP("firo-core", "Transaction too large"),
QT_TRANSLATE_NOOP("firo-core", "This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest something like

Suggested change
QT_TRANSLATE_NOOP("firo-core", "This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"),
QT_TRANSLATE_NOOP("firo-core", "transaction is too large (size limit: 100Kb). Select less inputs or consolidate your UTXOs"),

to make things clearer for non-technical users

QT_TRANSLATE_NOOP("firo-core", "Trying to spend an already spent serial #, try again."),
QT_TRANSLATE_NOOP("firo-core", "Unable to bind to %s on this computer (bind returned error %s)"),
QT_TRANSLATE_NOOP("firo-core", "Unable to bind to %s on this computer. %s is probably already running."),
Expand Down
4 changes: 2 additions & 2 deletions src/spark/sparkwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ bool CSparkWallet::CreateSparkMintTransactions(
// Limit size
CTransaction txConst(tx);
if (GetTransactionWeight(txConst) >= MAX_STANDARD_TX_WEIGHT) {
strFailReason = _("Transaction too large");
strFailReason = _("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure error message consistency and clarity.

- strFailReason = _("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again");
+ strFailReason = _("This transaction exceeds the transaction size limit of 100 kB. Please select fewer inputs or consolidate your UTXOs before trying to send again.");

The error message should maintain grammatical consistency ("fewer" instead of "less" for countable items like inputs) and clarity (adding a period before the suggestion). This change aligns with the updated messages in other parts of the codebase.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
strFailReason = _("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again");
strFailReason = _("This transaction exceeds the transaction size limit of 100 kB. Please select fewer inputs or consolidate your UTXOs before trying to send again.");

return false;
}
dPriority = txConst.ComputePriority(dPriority, nBytes);
Expand Down Expand Up @@ -1536,7 +1536,7 @@ CWalletTx CSparkWallet::CreateSparkSpendTransaction(
}

if (GetTransactionWeight(tx) >= MAX_NEW_TX_WEIGHT) {
throw std::runtime_error(_("Transaction too large"));
throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure error message consistency and clarity.

- throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"));
+ throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB. Please select fewer inputs or consolidate your UTXOs before trying to send again."));

Similar to the previous comment, this error message should also be updated for grammatical accuracy and consistency with other updated messages in the codebase.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"));
throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB. Please select fewer inputs or consolidate your UTXOs before trying to send again."));

}

// check fee
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/lelantusjoinsplitbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ CWalletTx LelantusJoinSplitBuilder::Build(
result.SetTx(MakeTransactionRef(tx));

if (GetTransactionWeight(tx) >= MAX_NEW_TX_WEIGHT) {
throw std::runtime_error(_("Transaction too large"));
throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"));
}

// check fee
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/txbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ CWalletTx TxBuilder::Build(const std::vector<CRecipient>& recipients, CAmount& f
result.SetTx(MakeTransactionRef(tx));

if (GetTransactionWeight(tx) >= MAX_STANDARD_TX_WEIGHT) {
throw std::runtime_error(_("Transaction too large"));
throw std::runtime_error(_("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again"));
}

// check fee
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4566,7 +4566,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT

if (GetTransactionWeight(txNew) >= MAX_STANDARD_TX_WEIGHT) {
// Do not create oversized transactions (bad-txns-oversize).
strFailReason = _("Transaction too large");
strFailReason = _("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again");
return false;
}

Expand Down Expand Up @@ -4991,7 +4991,7 @@ bool CWallet::CreateMintTransaction(const std::vector <CRecipient> &vecSend, CWa

// Limit size
if (GetTransactionWeight(*wtxNew.tx) >= MAX_STANDARD_TX_WEIGHT) {
strFailReason = _("Transaction too large");
strFailReason = _("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again");
return false;
}
dPriority = wtxNew.tx->ComputePriority(dPriority, nBytes);
Expand Down Expand Up @@ -5271,7 +5271,7 @@ bool CWallet::CreateLelantusMintTransactions(
// Limit size
CTransaction txConst(tx);
if (GetTransactionWeight(txConst) >= MAX_STANDARD_TX_WEIGHT) {
strFailReason = _("Transaction too large");
strFailReason = _("This transaction exceeds the transaction size limit of 100 kB, please select less inputs or consolidate your UTXOs before trying to send again");
return false;
}
dPriority = txConst.ComputePriority(dPriority, nBytes);
Expand Down
Loading