aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-01-03 19:04:34 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-03 19:04:41 +0100
commit9a2400b5755896b5e15d7a218ba6095160b845d5 (patch)
tree3f5bc1dec2970c591438b4d2543c2718b291fd09 /src/test
parent2dab2d239a4777b5ffd59a94a8eebd8638644e6c (diff)
parentfad140e311028f904635126e3c77352afac1b75e (diff)
Merge #20760: test: Set correct nValue for multi-op-return policy check
fad140e311028f904635126e3c77352afac1b75e test: Set correct nValue for multi-op-return policy check (MarcoFalke) Pull request description: `CTxOut::nValue` is default-initialized to `-1`. The dust-threshold for `OP_RETURN` outputs is `0`. Thus, the policy failure would be `dust` instead of `multi-op-return`. The test only passes because the dust check is currently not run. Avoid that confusion by setting the value to `0`, to ensure the dust check passes. ACKs for top commit: theStack: ACK fad140e311028f904635126e3c77352afac1b75e Tree-SHA512: f0c7a68eb2c573d6595b2b129fa8fa2a34fa35c17691f448bf1c54ccf66059c37562e7480cde7b51c4de677038d7717873da4257147a5f60acc8bbcd25fb7e3f
Diffstat (limited to 'src/test')
-rw-r--r--src/test/transaction_tests.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index 1f520074b1..5b35ed6976 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -762,7 +762,9 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
// Only one TxoutType::NULL_DATA permitted in all cases
t.vout.resize(2);
t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
+ t.vout[0].nValue = 0;
t.vout[1].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
+ t.vout[1].nValue = 0;
reason.clear();
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
BOOST_CHECK_EQUAL(reason, "multi-op-return");