You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

transaction_tests.cpp 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. // Copyright (c) 2011-2014 The Bitcoin Core developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #include "data/tx_invalid.json.h"
  5. #include "data/tx_valid.json.h"
  6. #include "test/test_bitcoin.h"
  7. #include "clientversion.h"
  8. #include "consensus/validation.h"
  9. #include "core_io.h"
  10. #include "key.h"
  11. #include "keystore.h"
  12. #include "main.h" // For CheckTransaction
  13. #include "policy/policy.h"
  14. #include "script/script.h"
  15. #include "script/script_error.h"
  16. #include "utilstrencodings.h"
  17. #include <map>
  18. #include <string>
  19. #include <boost/algorithm/string/classification.hpp>
  20. #include <boost/algorithm/string/split.hpp>
  21. #include <boost/assign/list_of.hpp>
  22. #include <boost/test/unit_test.hpp>
  23. #include <boost/assign/list_of.hpp>
  24. #include <univalue.h>
  25. using namespace std;
  26. // In script_tests.cpp
  27. extern UniValue read_json(const std::string& jsondata);
  28. static std::map<string, unsigned int> mapFlagNames = boost::assign::map_list_of
  29. (string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE)
  30. (string("P2SH"), (unsigned int)SCRIPT_VERIFY_P2SH)
  31. (string("STRICTENC"), (unsigned int)SCRIPT_VERIFY_STRICTENC)
  32. (string("DERSIG"), (unsigned int)SCRIPT_VERIFY_DERSIG)
  33. (string("LOW_S"), (unsigned int)SCRIPT_VERIFY_LOW_S)
  34. (string("SIGPUSHONLY"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY)
  35. (string("MINIMALDATA"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA)
  36. (string("NULLDUMMY"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY)
  37. (string("DISCOURAGE_UPGRADABLE_NOPS"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
  38. (string("CLEANSTACK"), (unsigned int)SCRIPT_VERIFY_CLEANSTACK)
  39. (string("CHECKLOCKTIMEVERIFY"), (unsigned int)SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY);
  40. unsigned int ParseScriptFlags(string strFlags)
  41. {
  42. if (strFlags.empty()) {
  43. return 0;
  44. }
  45. unsigned int flags = 0;
  46. vector<string> words;
  47. boost::algorithm::split(words, strFlags, boost::algorithm::is_any_of(","));
  48. BOOST_FOREACH(string word, words)
  49. {
  50. if (!mapFlagNames.count(word))
  51. BOOST_ERROR("Bad test: unknown verification flag '" << word << "'");
  52. flags |= mapFlagNames[word];
  53. }
  54. return flags;
  55. }
  56. string FormatScriptFlags(unsigned int flags)
  57. {
  58. if (flags == 0) {
  59. return "";
  60. }
  61. string ret;
  62. std::map<string, unsigned int>::const_iterator it = mapFlagNames.begin();
  63. while (it != mapFlagNames.end()) {
  64. if (flags & it->second) {
  65. ret += it->first + ",";
  66. }
  67. it++;
  68. }
  69. return ret.substr(0, ret.size() - 1);
  70. }
  71. BOOST_FIXTURE_TEST_SUITE(transaction_tests, BasicTestingSetup)
  72. BOOST_AUTO_TEST_CASE(tx_valid)
  73. {
  74. // Read tests from test/data/tx_valid.json
  75. // Format is an array of arrays
  76. // Inner arrays are either [ "comment" ]
  77. // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], serializedTransaction, verifyFlags
  78. // ... where all scripts are stringified scripts.
  79. //
  80. // verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
  81. UniValue tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid)));
  82. ScriptError err;
  83. for (unsigned int idx = 0; idx < tests.size(); idx++) {
  84. UniValue test = tests[idx];
  85. string strTest = test.write();
  86. if (test[0].isArray())
  87. {
  88. if (test.size() != 3 || !test[1].isStr() || !test[2].isStr())
  89. {
  90. BOOST_ERROR("Bad test: " << strTest);
  91. continue;
  92. }
  93. map<COutPoint, CScript> mapprevOutScriptPubKeys;
  94. UniValue inputs = test[0].get_array();
  95. bool fValid = true;
  96. for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
  97. const UniValue& input = inputs[inpIdx];
  98. if (!input.isArray())
  99. {
  100. fValid = false;
  101. break;
  102. }
  103. UniValue vinput = input.get_array();
  104. if (vinput.size() != 3)
  105. {
  106. fValid = false;
  107. break;
  108. }
  109. mapprevOutScriptPubKeys[COutPoint(uint256S(vinput[0].get_str()), vinput[1].get_int())] = ParseScript(vinput[2].get_str());
  110. }
  111. if (!fValid)
  112. {
  113. BOOST_ERROR("Bad test: " << strTest);
  114. continue;
  115. }
  116. string transaction = test[1].get_str();
  117. CDataStream stream(ParseHex(transaction), SER_NETWORK, PROTOCOL_VERSION);
  118. CTransaction tx;
  119. stream >> tx;
  120. CValidationState state;
  121. BOOST_CHECK_MESSAGE(CheckTransaction(tx, state), strTest);
  122. BOOST_CHECK(state.IsValid());
  123. for (unsigned int i = 0; i < tx.vin.size(); i++)
  124. {
  125. if (!mapprevOutScriptPubKeys.count(tx.vin[i].prevout))
  126. {
  127. BOOST_ERROR("Bad test: " << strTest);
  128. break;
  129. }
  130. unsigned int verify_flags = ParseScriptFlags(test[2].get_str());
  131. BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout],
  132. verify_flags, TransactionSignatureChecker(&tx, i), &err),
  133. strTest);
  134. BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));
  135. }
  136. }
  137. }
  138. }
  139. BOOST_AUTO_TEST_CASE(tx_invalid)
  140. {
  141. // Read tests from test/data/tx_invalid.json
  142. // Format is an array of arrays
  143. // Inner arrays are either [ "comment" ]
  144. // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],"], serializedTransaction, verifyFlags
  145. // ... where all scripts are stringified scripts.
  146. //
  147. // verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
  148. UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
  149. ScriptError err;
  150. for (unsigned int idx = 0; idx < tests.size(); idx++) {
  151. UniValue test = tests[idx];
  152. string strTest = test.write();
  153. if (test[0].isArray())
  154. {
  155. if (test.size() != 3 || !test[1].isStr() || !test[2].isStr())
  156. {
  157. BOOST_ERROR("Bad test: " << strTest);
  158. continue;
  159. }
  160. map<COutPoint, CScript> mapprevOutScriptPubKeys;
  161. UniValue inputs = test[0].get_array();
  162. bool fValid = true;
  163. for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
  164. const UniValue& input = inputs[inpIdx];
  165. if (!input.isArray())
  166. {
  167. fValid = false;
  168. break;
  169. }
  170. UniValue vinput = input.get_array();
  171. if (vinput.size() != 3)
  172. {
  173. fValid = false;
  174. break;
  175. }
  176. mapprevOutScriptPubKeys[COutPoint(uint256S(vinput[0].get_str()), vinput[1].get_int())] = ParseScript(vinput[2].get_str());
  177. }
  178. if (!fValid)
  179. {
  180. BOOST_ERROR("Bad test: " << strTest);
  181. continue;
  182. }
  183. string transaction = test[1].get_str();
  184. CDataStream stream(ParseHex(transaction), SER_NETWORK, PROTOCOL_VERSION);
  185. CTransaction tx;
  186. stream >> tx;
  187. CValidationState state;
  188. fValid = CheckTransaction(tx, state) && state.IsValid();
  189. for (unsigned int i = 0; i < tx.vin.size() && fValid; i++)
  190. {
  191. if (!mapprevOutScriptPubKeys.count(tx.vin[i].prevout))
  192. {
  193. BOOST_ERROR("Bad test: " << strTest);
  194. break;
  195. }
  196. unsigned int verify_flags = ParseScriptFlags(test[2].get_str());
  197. fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout],
  198. verify_flags, TransactionSignatureChecker(&tx, i), &err);
  199. }
  200. BOOST_CHECK_MESSAGE(!fValid, strTest);
  201. BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err));
  202. }
  203. }
  204. }
  205. BOOST_AUTO_TEST_CASE(basic_transaction_tests)
  206. {
  207. // Random real transaction (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436)
  208. unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00};
  209. vector<unsigned char> vch(ch, ch + sizeof(ch) -1);
  210. CDataStream stream(vch, SER_DISK, CLIENT_VERSION);
  211. CMutableTransaction tx;
  212. stream >> tx;
  213. CValidationState state;
  214. BOOST_CHECK_MESSAGE(CheckTransaction(tx, state) && state.IsValid(), "Simple deserialized transaction should be valid.");
  215. // Check that duplicate txins fail
  216. tx.vin.push_back(tx.vin[0]);
  217. BOOST_CHECK_MESSAGE(!CheckTransaction(tx, state) || !state.IsValid(), "Transaction with duplicate txins should be invalid.");
  218. }
  219. //
  220. // Helper: create two dummy transactions, each with
  221. // two outputs. The first has 11 and 50 CENT outputs
  222. // paid to a TX_PUBKEY, the second 21 and 22 CENT outputs
  223. // paid to a TX_PUBKEYHASH.
  224. //
  225. static std::vector<CMutableTransaction>
  226. SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet)
  227. {
  228. std::vector<CMutableTransaction> dummyTransactions;
  229. dummyTransactions.resize(2);
  230. // Add some keys to the keystore:
  231. CKey key[4];
  232. for (int i = 0; i < 4; i++)
  233. {
  234. key[i].MakeNewKey(i % 2);
  235. keystoreRet.AddKey(key[i]);
  236. }
  237. // Create some dummy input transactions
  238. dummyTransactions[0].vout.resize(2);
  239. dummyTransactions[0].vout[0].nValue = 11*CENT;
  240. dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG;
  241. dummyTransactions[0].vout[1].nValue = 50*CENT;
  242. dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG;
  243. coinsRet.ModifyCoins(dummyTransactions[0].GetHash())->FromTx(dummyTransactions[0], 0);
  244. dummyTransactions[1].vout.resize(2);
  245. dummyTransactions[1].vout[0].nValue = 21*CENT;
  246. dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID());
  247. dummyTransactions[1].vout[1].nValue = 22*CENT;
  248. dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID());
  249. coinsRet.ModifyCoins(dummyTransactions[1].GetHash())->FromTx(dummyTransactions[1], 0);
  250. return dummyTransactions;
  251. }
  252. BOOST_AUTO_TEST_CASE(test_Get)
  253. {
  254. CBasicKeyStore keystore;
  255. CCoinsView coinsDummy;
  256. CCoinsViewCache coins(&coinsDummy);
  257. std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);
  258. CMutableTransaction t1;
  259. t1.vin.resize(3);
  260. t1.vin[0].prevout.hash = dummyTransactions[0].GetHash();
  261. t1.vin[0].prevout.n = 1;
  262. t1.vin[0].scriptSig << std::vector<unsigned char>(65, 0);
  263. t1.vin[1].prevout.hash = dummyTransactions[1].GetHash();
  264. t1.vin[1].prevout.n = 0;
  265. t1.vin[1].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
  266. t1.vin[2].prevout.hash = dummyTransactions[1].GetHash();
  267. t1.vin[2].prevout.n = 1;
  268. t1.vin[2].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);
  269. t1.vout.resize(2);
  270. t1.vout[0].nValue = 90*CENT;
  271. t1.vout[0].scriptPubKey << OP_1;
  272. BOOST_CHECK(AreInputsStandard(t1, coins));
  273. BOOST_CHECK_EQUAL(coins.GetValueIn(t1), (50+21+22)*CENT);
  274. // Adding extra junk to the scriptSig should make it non-standard:
  275. t1.vin[0].scriptSig << OP_11;
  276. BOOST_CHECK(!AreInputsStandard(t1, coins));
  277. // ... as should not having enough:
  278. t1.vin[0].scriptSig = CScript();
  279. BOOST_CHECK(!AreInputsStandard(t1, coins));
  280. }
  281. BOOST_AUTO_TEST_CASE(test_IsStandard)
  282. {
  283. LOCK(cs_main);
  284. CBasicKeyStore keystore;
  285. CCoinsView coinsDummy;
  286. CCoinsViewCache coins(&coinsDummy);
  287. std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);
  288. CMutableTransaction t;
  289. t.vin.resize(1);
  290. t.vin[0].prevout.hash = dummyTransactions[0].GetHash();
  291. t.vin[0].prevout.n = 1;
  292. t.vin[0].scriptSig << std::vector<unsigned char>(65, 0);
  293. t.vout.resize(1);
  294. t.vout[0].nValue = 90*CENT;
  295. CKey key;
  296. key.MakeNewKey(true);
  297. t.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID());
  298. string reason;
  299. BOOST_CHECK(IsStandardTx(t, reason));
  300. // Check dust with default relay fee:
  301. CAmount nDustThreshold = 182 * minRelayTxFee.GetFeePerK()/1000 * 3;
  302. BOOST_CHECK_EQUAL(nDustThreshold, 546);
  303. // dust:
  304. t.vout[0].nValue = nDustThreshold - 1;
  305. BOOST_CHECK(!IsStandardTx(t, reason));
  306. // not dust:
  307. t.vout[0].nValue = nDustThreshold;
  308. BOOST_CHECK(IsStandardTx(t, reason));
  309. // Check dust with odd relay fee to verify rounding:
  310. // nDustThreshold = 182 * 1234 / 1000 * 3
  311. minRelayTxFee = CFeeRate(1234);
  312. // dust:
  313. t.vout[0].nValue = 672 - 1;
  314. BOOST_CHECK(!IsStandardTx(t, reason));
  315. // not dust:
  316. t.vout[0].nValue = 672;
  317. BOOST_CHECK(IsStandardTx(t, reason));
  318. minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
  319. t.vout[0].scriptPubKey = CScript() << OP_1;
  320. BOOST_CHECK(!IsStandardTx(t, reason));
  321. // MAX_OP_RETURN_RELAY-byte TX_NULL_DATA (standard)
  322. t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
  323. BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY, t.vout[0].scriptPubKey.size());
  324. BOOST_CHECK(IsStandardTx(t, reason));
  325. // MAX_OP_RETURN_RELAY+1-byte TX_NULL_DATA (non-standard)
  326. t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800");
  327. BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY + 1, t.vout[0].scriptPubKey.size());
  328. BOOST_CHECK(!IsStandardTx(t, reason));
  329. // Data payload can be encoded in any way...
  330. t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("");
  331. BOOST_CHECK(IsStandardTx(t, reason));
  332. t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("00") << ParseHex("01");
  333. BOOST_CHECK(IsStandardTx(t, reason));
  334. // OP_RESERVED *is* considered to be a PUSHDATA type opcode by IsPushOnly()!
  335. t.vout[0].scriptPubKey = CScript() << OP_RETURN << OP_RESERVED << -1 << 0 << ParseHex("01") << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15 << 16;
  336. BOOST_CHECK(IsStandardTx(t, reason));
  337. t.vout[0].scriptPubKey = CScript() << OP_RETURN << 0 << ParseHex("01") << 2 << ParseHex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
  338. BOOST_CHECK(IsStandardTx(t, reason));
  339. // ...so long as it only contains PUSHDATA's
  340. t.vout[0].scriptPubKey = CScript() << OP_RETURN << OP_RETURN;
  341. BOOST_CHECK(!IsStandardTx(t, reason));
  342. // TX_NULL_DATA w/o PUSHDATA
  343. t.vout.resize(1);
  344. t.vout[0].scriptPubKey = CScript() << OP_RETURN;
  345. BOOST_CHECK(IsStandardTx(t, reason));
  346. // Only one TX_NULL_DATA permitted in all cases
  347. t.vout.resize(2);
  348. t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
  349. t.vout[1].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
  350. BOOST_CHECK(!IsStandardTx(t, reason));
  351. t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
  352. t.vout[1].scriptPubKey = CScript() << OP_RETURN;
  353. BOOST_CHECK(!IsStandardTx(t, reason));
  354. t.vout[0].scriptPubKey = CScript() << OP_RETURN;
  355. t.vout[1].scriptPubKey = CScript() << OP_RETURN;
  356. BOOST_CHECK(!IsStandardTx(t, reason));
  357. }
  358. BOOST_AUTO_TEST_SUITE_END()