refactor(test): Make CAmount arg explicit for BuildCreditingTransaction()
What changed, and why it matters
This is a tiny internal test-only code cleanup. It changes one function parameter in test helper code from the generic 'int' type to the project's specific 'CAmount' type, which is used for money values. It does not change any production code, network behavior, or wallet logic, and there is no security issue here.
No action needed. This is a benign test-only refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors the test utility BuildCreditingTransaction() in src/test/util/transaction_utils.cpp/.h, changing the nValue parameter type from int to CAmount. CAmount is a typedef for int64_t used for satoshi values in Bitcoin Core. This is a type-safety improvement in test-only code with no functional change to consensus, networking, or wallet code.
Changed components
src/test/util/transaction_utils.cppsrc/test/util/transaction_utils.hInspect captured patch +2 / −2
diff --git a/src/test/util/transaction_utils.cpp b/src/test/util/transaction_utils.cpp
index b65a9568..cf4ed934 100644
--- a/src/test/util/transaction_utils.cpp
+++ b/src/test/util/transaction_utils.cpp
@@ -7,7 +7,7 @@
#include <script/signingprovider.h>
#include <test/util/transaction_utils.h>
-CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue)
+CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, CAmount nValue)
{
CMutableTransaction txCredit;
txCredit.version = 1;
diff --git a/src/test/util/transaction_utils.h b/src/test/util/transaction_utils.h
index 867554f8..ca643f0b 100644
--- a/src/test/util/transaction_utils.h
+++ b/src/test/util/transaction_utils.h
@@ -15,7 +15,7 @@ class CCoinsViewCache;
// create crediting transaction
// [1 coinbase input => 1 output with given scriptPubkey and value]
-CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);
+CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, CAmount nValue = 0);
// create spending transaction
// [1 input with referenced transaction outpoint, scriptSig, scriptWitness =>
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.