Changeset View
Changeset View
Standalone View
Standalone View
src/test/transaction_tests.cpp
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(tx_invalid) { | ||||
// ... where all scripts are stringified scripts. | // ... where all scripts are stringified scripts. | ||||
// | // | ||||
// verifyFlags is a comma separated list of script verification flags to | // verifyFlags is a comma separated list of script verification flags to | ||||
// apply, or "NONE" | // apply, or "NONE" | ||||
UniValue tests = read_json( | UniValue tests = read_json( | ||||
std::string(json_tests::tx_invalid, | std::string(json_tests::tx_invalid, | ||||
json_tests::tx_invalid + sizeof(json_tests::tx_invalid))); | json_tests::tx_invalid + sizeof(json_tests::tx_invalid))); | ||||
ScriptError err; | // Initialize to SCRIPT_ERR_OK. The tests expect err to be changed to a | ||||
// value other than SCRIPT_ERR_OK. | |||||
ScriptError err = SCRIPT_ERR_OK; | |||||
for (size_t idx = 0; idx < tests.size(); idx++) { | for (size_t idx = 0; idx < tests.size(); idx++) { | ||||
UniValue test = tests[idx]; | UniValue test = tests[idx]; | ||||
std::string strTest = test.write(); | std::string strTest = test.write(); | ||||
if (test[0].isArray()) { | if (test[0].isArray()) { | ||||
if (test.size() != 3 || !test[1].isStr() || !test[2].isStr()) { | if (test.size() != 3 || !test[1].isStr() || !test[2].isStr()) { | ||||
BOOST_ERROR("Bad test: " << strTest); | BOOST_ERROR("Bad test: " << strTest); | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 650 Lines • Show Last 20 Lines |