Skip to content

Commit

Permalink
[WIP] First tapminiscript test
Browse files Browse the repository at this point in the history
  • Loading branch information
bigspider committed Apr 26, 2023
1 parent d64a1db commit 988f2d3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_e2e_tapscripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 988f2d3

Please sign in to comment.