diff --git a/tests/test_e2e_tapscripts.py b/tests/test_e2e_tapscripts.py index debaf4da..d9d2676f 100644 --- a/tests/test_e2e_tapscripts.py +++ b/tests/test_e2e_tapscripts.py @@ -286,3 +286,27 @@ def test_e2e_tapscript_large(rpc, rpc_test_wallet, client: Client, speculos_glob keys_info=keys_info) run_test_e2e(wallet_policy, [core_wallet_name], rpc, rpc_test_wallet, client, speculos_globals, comm) + + +def test_e2e_tapminiscript_keypath_or_decaying_3of3(rpc, rpc_test_wallet, client: Client, speculos_globals: SpeculosGlobals, comm: Union[TransportClient, SpeculosClient]): + # The key path is external + # The only script path is a decaying 3-of-3 that becomes a 2-of-3 after the timelock. + # Only one internal key in the script path. + + path = "499'/1'/0'" + _, core_xpub_orig_1 = create_new_wallet() + core_name_2, core_xpub_orig_2 = create_new_wallet() + core_name_3, core_xpub_orig_3 = create_new_wallet() + internal_xpub = get_internal_xpub(speculos_globals.seed, path) + wallet_policy = WalletPolicy( + name="Internal or decaying 3-of-3", + descriptor_template="tr(@0/**,thresh(3,pk(@1/**),s:pk(@2/**),s:pk(@3/**),sln:older(12960)))", + keys_info=[ + f"{core_xpub_orig_1}", + f"[{speculos_globals.master_key_fingerprint.hex()}/{path}]{internal_xpub}", + f"{core_xpub_orig_2}", + f"{core_xpub_orig_3}", + ]) + + run_test_e2e(wallet_policy, [core_name_2, core_name_3], + rpc, rpc_test_wallet, client, speculos_globals, comm)