Skip to content

Commit e0287bc

Browse files
committed
test: remove unused code from script_tests
This has been unused since #29648. Noticed while running a newer version of clang-tidy (19.1.1): ```bash [127/391][6.2s] /opt/homebrew/opt/llvm/bin/clang-tidy -p=build -quiet --config-file=/bitcoin/src/.clang-tidy /bitcoin/src/test/script_tests.cpp bitcoin/src/test/script_tests.cpp:126:25: error: local copy 'tx2' of the variable 'tx' is never modified and never used; consider removing the statement [performance-unnecessary-copy-initialization,-warnings-as-errors] 126 | CMutableTransaction tx2 = tx; | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ 127 | BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err) == expect, message); 512 warnings generated. ```
1 parent 62e4516 commit e0287bc

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/test/script_tests.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript
123123
ScriptError err;
124124
const CTransaction txCredit{BuildCreditingTransaction(scriptPubKey, nValue)};
125125
CMutableTransaction tx = BuildSpendingTransaction(scriptSig, scriptWitness, txCredit);
126-
CMutableTransaction tx2 = tx;
127126
BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err) == expect, message);
128127
BOOST_CHECK_MESSAGE(err == scriptError, FormatScriptError(err) + " where " + FormatScriptError((ScriptError_t)scriptError) + " expected: " + message);
129128

0 commit comments

Comments
 (0)