diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-10-18 19:03:57 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-10-18 19:06:01 +0300 |
commit | 76bbcc414f3001b16ac0101f738ed0b3e6f1a372 (patch) | |
tree | 19186b451d459e5448679485668b485d547efc41 /src/test/script_tests.cpp | |
parent | 80c8a02f1b4f6ad2b5c02595d66a74db22373ed4 (diff) |
test: Fix -Wunused-function warning if configured --without-libs
This is a move-only change.
Diffstat (limited to 'src/test/script_tests.cpp')
-rw-r--r-- | src/test/script_tests.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index a2efd8ac07..7c53bd0002 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1347,36 +1347,6 @@ static CScript ScriptFromHex(const std::string& str) return CScript(data.begin(), data.end()); } -static CMutableTransaction TxFromHex(const std::string& str) -{ - CMutableTransaction tx; - VectorReader(SER_DISK, SERIALIZE_TRANSACTION_NO_WITNESS, ParseHex(str), 0) >> tx; - return tx; -} - -static std::vector<CTxOut> TxOutsFromJSON(const UniValue& univalue) -{ - assert(univalue.isArray()); - std::vector<CTxOut> prevouts; - for (size_t i = 0; i < univalue.size(); ++i) { - CTxOut txout; - VectorReader(SER_DISK, 0, ParseHex(univalue[i].get_str()), 0) >> txout; - prevouts.push_back(std::move(txout)); - } - return prevouts; -} - -static CScriptWitness ScriptWitnessFromJSON(const UniValue& univalue) -{ - assert(univalue.isArray()); - CScriptWitness scriptwitness; - for (size_t i = 0; i < univalue.size(); ++i) { - auto bytes = ParseHex(univalue[i].get_str()); - scriptwitness.stack.push_back(std::move(bytes)); - } - return scriptwitness; -} - BOOST_AUTO_TEST_CASE(script_FindAndDelete) { // Exercise the FindAndDelete functionality @@ -1502,6 +1472,36 @@ BOOST_AUTO_TEST_CASE(script_HasValidOps) #if defined(HAVE_CONSENSUS_LIB) +static CMutableTransaction TxFromHex(const std::string& str) +{ + CMutableTransaction tx; + VectorReader(SER_DISK, SERIALIZE_TRANSACTION_NO_WITNESS, ParseHex(str), 0) >> tx; + return tx; +} + +static std::vector<CTxOut> TxOutsFromJSON(const UniValue& univalue) +{ + assert(univalue.isArray()); + std::vector<CTxOut> prevouts; + for (size_t i = 0; i < univalue.size(); ++i) { + CTxOut txout; + VectorReader(SER_DISK, 0, ParseHex(univalue[i].get_str()), 0) >> txout; + prevouts.push_back(std::move(txout)); + } + return prevouts; +} + +static CScriptWitness ScriptWitnessFromJSON(const UniValue& univalue) +{ + assert(univalue.isArray()); + CScriptWitness scriptwitness; + for (size_t i = 0; i < univalue.size(); ++i) { + auto bytes = ParseHex(univalue[i].get_str()); + scriptwitness.stack.push_back(std::move(bytes)); + } + return scriptwitness; +} + /* Test simple (successful) usage of bitcoinconsensus_verify_script */ BOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_returns_true) { |