File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -221,13 +221,22 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
221221 BOOST_CHECK (ExtractDestination (s, address));
222222 BOOST_CHECK (boost::get<WitnessV0ScriptHash>(&address) && *boost::get<WitnessV0ScriptHash>(&address) == scripthash);
223223
224+ // TX_WITNESS_V1_SCRIPTHASH
225+ s.clear ();
226+ WitnessV1Point taproot (pubkey);
227+ auto modified_key = ToByteVector (pubkey);
228+ modified_key[0 ] -= 2 ;
229+ s << OP_1 << modified_key;
230+ BOOST_CHECK (ExtractDestination (s, address));
231+ BOOST_CHECK (boost::get<WitnessV1Point>(&address) && *boost::get<WitnessV1Point>(&address) == taproot);
232+
224233 // TX_WITNESS with unknown version
225234 s.clear ();
226- s << OP_1 << ToByteVector (pubkey);
235+ s << OP_2 << ToByteVector (pubkey);
227236 BOOST_CHECK (ExtractDestination (s, address));
228237 WitnessUnknown unk;
229238 unk.length = 33 ;
230- unk.version = 1 ;
239+ unk.version = 2 ;
231240 std::copy (pubkey.begin (), pubkey.end (), unk.program );
232241 BOOST_CHECK (boost::get<WitnessUnknown>(&address) && *boost::get<WitnessUnknown>(&address) == unk);
233242}
You can’t perform that action at this time.
0 commit comments