Skip to content

Commit fa59e0b

Browse files
author
MarcoFalke
committed
test: Add missing script_standard_Solver_success cases
1 parent 4538501 commit fa59e0b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/test/script_standard_tests.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_success)
107107
BOOST_CHECK_EQUAL(solutions.size(), 1U);
108108
BOOST_CHECK(solutions[0] == ToByteVector(scriptHash));
109109

110+
// TxoutType::WITNESS_V1_TAPROOT
111+
s.clear();
112+
s << OP_1 << ToByteVector(uint256::ZERO);
113+
BOOST_CHECK_EQUAL(Solver(s, solutions), TxoutType::WITNESS_V1_TAPROOT);
114+
BOOST_CHECK_EQUAL(solutions.size(), 2U);
115+
BOOST_CHECK(solutions[0] == std::vector<unsigned char>{1});
116+
BOOST_CHECK(solutions[1] == ToByteVector(uint256::ZERO));
117+
118+
// TxoutType::WITNESS_UNKNOWN
119+
s.clear();
120+
s << OP_16 << ToByteVector(uint256::ONE);
121+
BOOST_CHECK_EQUAL(Solver(s, solutions), TxoutType::WITNESS_UNKNOWN);
122+
BOOST_CHECK_EQUAL(solutions.size(), 2U);
123+
BOOST_CHECK(solutions[0] == std::vector<unsigned char>{16});
124+
BOOST_CHECK(solutions[1] == ToByteVector(uint256::ONE));
125+
110126
// TxoutType::NONSTANDARD
111127
s.clear();
112128
s << OP_9 << OP_ADD << OP_11 << OP_EQUAL;

0 commit comments

Comments
 (0)