aboutsummaryrefslogtreecommitdiff
path: root/src/test/script_standard_tests.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-10-21 13:48:39 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-10-21 13:50:47 +0200
commitfa59e0b5bd2aed8380cc9b9e52791f662aecd6a6 (patch)
tree8261023053b42fceeadd9e88fe858909de055fc0 /src/test/script_standard_tests.cpp
parent45385018e13e167521e655c36128d8ee4f2a3e0b (diff)
test: Add missing script_standard_Solver_success cases
Diffstat (limited to 'src/test/script_standard_tests.cpp')
-rw-r--r--src/test/script_standard_tests.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/script_standard_tests.cpp b/src/test/script_standard_tests.cpp
index 1d6bcadf69..5970d6857c 100644
--- a/src/test/script_standard_tests.cpp
+++ b/src/test/script_standard_tests.cpp
@@ -107,6 +107,22 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_success)
BOOST_CHECK_EQUAL(solutions.size(), 1U);
BOOST_CHECK(solutions[0] == ToByteVector(scriptHash));
+ // TxoutType::WITNESS_V1_TAPROOT
+ s.clear();
+ s << OP_1 << ToByteVector(uint256::ZERO);
+ BOOST_CHECK_EQUAL(Solver(s, solutions), TxoutType::WITNESS_V1_TAPROOT);
+ BOOST_CHECK_EQUAL(solutions.size(), 2U);
+ BOOST_CHECK(solutions[0] == std::vector<unsigned char>{1});
+ BOOST_CHECK(solutions[1] == ToByteVector(uint256::ZERO));
+
+ // TxoutType::WITNESS_UNKNOWN
+ s.clear();
+ s << OP_16 << ToByteVector(uint256::ONE);
+ BOOST_CHECK_EQUAL(Solver(s, solutions), TxoutType::WITNESS_UNKNOWN);
+ BOOST_CHECK_EQUAL(solutions.size(), 2U);
+ BOOST_CHECK(solutions[0] == std::vector<unsigned char>{16});
+ BOOST_CHECK(solutions[1] == ToByteVector(uint256::ONE));
+
// TxoutType::NONSTANDARD
s.clear();
s << OP_9 << OP_ADD << OP_11 << OP_EQUAL;