mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
refactor: Replace const char* to std::string
Some functions should be returning std::string instead of const char*. This commit changes that.
This commit is contained in:
@@ -102,7 +102,7 @@ static ScriptErrorDesc script_errors[]={
|
||||
{SCRIPT_ERR_SIG_FINDANDDELETE, "SIG_FINDANDDELETE"},
|
||||
};
|
||||
|
||||
static const char *FormatScriptError(ScriptError_t err)
|
||||
static std::string FormatScriptError(ScriptError_t err)
|
||||
{
|
||||
for (unsigned int i=0; i<ARRAYLEN(script_errors); ++i)
|
||||
if (script_errors[i].err == err)
|
||||
@@ -134,7 +134,7 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript
|
||||
CMutableTransaction tx = BuildSpendingTransaction(scriptSig, scriptWitness, txCredit);
|
||||
CMutableTransaction tx2 = tx;
|
||||
BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue), &err) == expect, message);
|
||||
BOOST_CHECK_MESSAGE(err == scriptError, std::string(FormatScriptError(err)) + " where " + std::string(FormatScriptError((ScriptError_t)scriptError)) + " expected: " + message);
|
||||
BOOST_CHECK_MESSAGE(err == scriptError, FormatScriptError(err) + " where " + FormatScriptError((ScriptError_t)scriptError) + " expected: " + message);
|
||||
|
||||
// Verify that removing flags from a passing test or adding flags to a failing test does not change the result.
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user