From 1b37b2d605b646a590275fe0dba0039ecef421c3 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 25 Feb 2016 15:51:43 +0000 Subject: [PATCH] test_IsStandard: Work with any MAX_OP_RETURN_RELAY --- src/test/transaction_tests.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index fc9a61e624..9823c6a3c3 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -873,12 +873,15 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) g_mempool_opts.reject_tokens = false; // MAX_OP_RETURN_RELAY-byte TxoutType::NULL_DATA (standard) - t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38"); + t.vout[0].scriptPubKey = CScript() << OP_RETURN; + while (t.vout[0].scriptPubKey.size() < MAX_OP_RETURN_RELAY) { + t.vout[0].scriptPubKey << OP_0; + } BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY, t.vout[0].scriptPubKey.size()); CheckIsStandard(t); // MAX_OP_RETURN_RELAY+1-byte TxoutType::NULL_DATA (non-standard) - t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800"); + t.vout[0].scriptPubKey << OP_0; BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY + 1, t.vout[0].scriptPubKey.size()); CheckIsNotStandard(t, "scriptpubkey");