Change Solver() output for WITNESS_V1_TAPROOT

This is just a small simplification to prepare for the follow-up instruction
of a CTxDestination variant for taproot outputs.

In the old code, WITNESS_V1_TAPROOT and WITNESS_UNKNOWN both produced
{version, program} as Solver() output. Change this so that WITNESS_V1_TAPROOT
produces just {program}, like WITNESS_V0_* do.
This commit is contained in:
Pieter Wuille
2021-05-23 18:00:18 -07:00
parent 4b1cc08f9f
commit 31df02a070
2 changed files with 14 additions and 7 deletions

View File

@@ -111,9 +111,8 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_success)
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));
BOOST_CHECK_EQUAL(solutions.size(), 1U);
BOOST_CHECK(solutions[0] == ToByteVector(uint256::ZERO));
// TxoutType::WITNESS_UNKNOWN
s.clear();