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)
221
221
BOOST_CHECK (ExtractDestination (s, address));
222
222
BOOST_CHECK (boost::get<WitnessV0ScriptHash>(&address) && *boost::get<WitnessV0ScriptHash>(&address) == scripthash);
223
223
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
+
224
233
// TX_WITNESS with unknown version
225
234
s.clear ();
226
- s << OP_1 << ToByteVector (pubkey);
235
+ s << OP_2 << ToByteVector (pubkey);
227
236
BOOST_CHECK (ExtractDestination (s, address));
228
237
WitnessUnknown unk;
229
238
unk.length = 33 ;
230
- unk.version = 1 ;
239
+ unk.version = 2 ;
231
240
std::copy (pubkey.begin (), pubkey.end (), unk.program );
232
241
BOOST_CHECK (boost::get<WitnessUnknown>(&address) && *boost::get<WitnessUnknown>(&address) == unk);
233
242
}
You can’t perform that action at this time.
0 commit comments