aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2013-10-24 04:32:35 -0400
committerPeter Todd <pete@petertodd.org>2013-10-24 04:32:35 -0400
commit22de68dffc1e94c5b06b7e512140c42290cb4f5d (patch)
tree9f723331f610480aa0af80aff36411bc2a3c6b95 /src/test/transaction_tests.cpp
parent125bdead3e9be9a6ce23129409612a4d8501980b (diff)
downloadbitcoin-22de68dffc1e94c5b06b7e512140c42290cb4f5d.tar.xz
Relay OP_RETURN TxOut as standard transaction type
Also fix decoderawtransaction to not show reqSigs or addresses for nulldata txouts. (Previous version also left reqSigs uninitialized mistakenly)
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r--src/test/transaction_tests.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index d68ead1cd0..c6bc2e8aa1 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -282,11 +282,24 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800");
BOOST_CHECK(!IsStandardTx(t, reason));
- // Only one TX_NULL_DATA permitted
+ // TX_NULL_DATA w/o PUSHDATA
+ t.vout.resize(1);
+ t.vout[0].scriptPubKey = CScript() << OP_RETURN;
+ BOOST_CHECK(IsStandardTx(t, reason));
+
+ // Only one TX_NULL_DATA permitted in all cases
t.vout.resize(2);
t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
t.vout[1].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
BOOST_CHECK(!IsStandardTx(t, reason));
+
+ t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
+ t.vout[1].scriptPubKey = CScript() << OP_RETURN;
+ BOOST_CHECK(!IsStandardTx(t, reason));
+
+ t.vout[0].scriptPubKey = CScript() << OP_RETURN;
+ t.vout[1].scriptPubKey = CScript() << OP_RETURN;
+ BOOST_CHECK(!IsStandardTx(t, reason));
}
BOOST_AUTO_TEST_SUITE_END()