mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 88776c2926 into merged_master (Bitcoin PR #20245)
This commit is contained in:
commit
76437996fb
2 changed files with 12 additions and 11 deletions
|
|
@ -106,18 +106,18 @@ static ScriptErrorDesc script_errors[]={
|
|||
|
||||
static std::string FormatScriptError(ScriptError_t err)
|
||||
{
|
||||
for (unsigned int i=0; i<ARRAYLEN(script_errors); ++i)
|
||||
if (script_errors[i].err == err)
|
||||
return script_errors[i].name;
|
||||
for (const auto& se : script_errors)
|
||||
if (se.err == err)
|
||||
return se.name;
|
||||
BOOST_ERROR("Unknown scripterror enumeration value, update script_errors in script_tests.cpp.");
|
||||
return "";
|
||||
}
|
||||
|
||||
static ScriptError_t ParseScriptError(const std::string &name)
|
||||
static ScriptError_t ParseScriptError(const std::string& name)
|
||||
{
|
||||
for (unsigned int i=0; i<ARRAYLEN(script_errors); ++i)
|
||||
if (script_errors[i].name == name)
|
||||
return script_errors[i].err;
|
||||
for (const auto& se : script_errors)
|
||||
if (se.name == name)
|
||||
return se.err;
|
||||
BOOST_ERROR("Unknown scripterror \"" << name << "\" in test description");
|
||||
return SCRIPT_ERR_UNKNOWN_ERROR;
|
||||
}
|
||||
|
|
@ -1474,8 +1474,6 @@ BOOST_AUTO_TEST_CASE(script_HasValidOps)
|
|||
BOOST_CHECK(!script.HasValidOps());
|
||||
}
|
||||
|
||||
#if defined(HAVE_CONSENSUS_LIB)
|
||||
|
||||
static CMutableTransaction TxFromHex(const std::string& str)
|
||||
{
|
||||
CMutableTransaction tx;
|
||||
|
|
@ -1506,6 +1504,8 @@ static CScriptWitness ScriptWitnessFromJSON(const UniValue& univalue)
|
|||
return scriptwitness;
|
||||
}
|
||||
|
||||
#if defined(HAVE_CONSENSUS_LIB)
|
||||
|
||||
/* Test simple (successful) usage of bitcoinconsensus_verify_script */
|
||||
BOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_returns_true)
|
||||
{
|
||||
|
|
@ -1644,6 +1644,8 @@ BOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_invalid_flags)
|
|||
BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_INVALID_FLAGS);
|
||||
}
|
||||
|
||||
#endif // defined(HAVE_CONSENSUS_LIB)
|
||||
|
||||
static std::vector<unsigned int> AllConsensusFlags()
|
||||
{
|
||||
std::vector<unsigned int> ret;
|
||||
|
|
@ -1747,5 +1749,4 @@ BOOST_AUTO_TEST_CASE(script_assets_test)
|
|||
file.close();
|
||||
}
|
||||
|
||||
#endif
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue