mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
test: characterize P2WSH miniscript output
Add a relative-timelock case that consults the transaction checker during output metadata traversal. Use a valid input because the pre-fix missing-input path is only reliably diagnosed under a sanitizer.
This commit is contained in:
@@ -292,6 +292,16 @@ BOOST_AUTO_TEST_CASE(update_psbt_output_witness_script)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(update_psbt_output_miniscript_timelock)
|
||||
{
|
||||
for (bool has_input : {true}) { // TODO: Zero-input updates read a missing input through the checker.
|
||||
PSBTOutputTest test{"wsh(and_v(v:pk(<KEY>),older(144)))"};
|
||||
auto out{test.UpdateOutput(has_input)};
|
||||
BOOST_CHECK(GetScriptForDestination(WitnessV0ScriptHash{out.witness_script}) == test.script_pubkey);
|
||||
BOOST_CHECK(out.hd_keypaths.contains(test.pubkey));
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(update_psbt_output_taproot)
|
||||
{
|
||||
for (bool has_input : {false, true}) {
|
||||
|
||||
Reference in New Issue
Block a user