Skip to content

Commit 6459647

Browse files
committed
test/transaction_tests: Add rejecttokens test to test_IsStandard
1 parent 8ac857b commit 6459647

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/transaction_tests.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,17 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
850850
t.vout[0].scriptPubKey = CScript() << OP_1;
851851
CheckIsNotStandard(t, "scriptpubkey");
852852

853+
// Test rejecttokens
854+
t.vout[0].scriptPubKey = CScript() << OP_RETURN << OP_13 << OP_FALSE;
855+
g_mempool_opts.reject_tokens = false;
856+
CheckIsStandard(t);
857+
g_mempool_opts.reject_tokens = true;
858+
CheckIsNotStandard(t, "tokens-runes");
859+
// At least one data push is needed after OP_13 to match
860+
t.vout[0].scriptPubKey = CScript() << OP_RETURN << OP_13;
861+
CheckIsStandard(t);
862+
g_mempool_opts.reject_tokens = false;
863+
853864
// MAX_OP_RETURN_RELAY-byte TxoutType::NULL_DATA (standard)
854865
t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
855866
BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY, t.vout[0].scriptPubKey.size());

0 commit comments

Comments
 (0)