Skip to content

Commit

Permalink
Fix test for hardened paths using either 'h' or single quotes; run al…
Browse files Browse the repository at this point in the history
…l tests
  • Loading branch information
fmhoeger committed Jan 4, 2024
1 parent 7092d8a commit 79bf7c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pyln-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
run: cargo build
- name: Run pyln tests
timeout-minutes: 5
run: cd tests && poetry run pytest test_rpc.py -v
run: cd tests && poetry run pytest -v
17 changes: 4 additions & 13 deletions tests/test_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,10 @@ def test_rpc_list(bitcoind, ln_node):
== sorted(list(smaug_wallet_2.keys()))
== asserted_keys
)

regex_ns_d = (
r"^wpkh\(\[[a-f0-9]{8}\/84h\/1h\/0h\]tpub[a-zA-Z0-9]{107}\/0\/\*\)#[a-z0-9]{8}$"
)
regex_ns_cd = (
r"^wpkh\(\[[a-f0-9]{8}\/84h\/1h\/0h\]tpub[a-zA-Z0-9]{107}\/1\/\*\)#[a-z0-9]{8}$"
)
regex_tr_d = (
r"^tr\(\[[a-f0-9]{8}\/86h\/1h\/0h\]tpub[a-zA-Z0-9]{107}\/0\/\*\)#[a-z0-9]{8}$"
)
regex_tr_cd = (
r"^tr\(\[[a-f0-9]{8}\/86h\/1h\/0h\]tpub[a-zA-Z0-9]{107}\/1\/\*\)#[a-z0-9]{8}$"
)
regex_ns_d = r"^wpkh\(\[[a-f0-9]{8}\/84(h|')\/1(h|')\/0(h|')\]tpub[a-zA-Z0-9]{107}\/0\/\*\)#[a-z0-9]{8}$"
regex_ns_cd = r"^wpkh\(\[[a-f0-9]{8}\/84(h|')\/1(h|')\/0(h|')\]tpub[a-zA-Z0-9]{107}\/1\/\*\)#[a-z0-9]{8}$"
regex_tr_d = r"^tr\(\[[a-f0-9]{8}\/86(h|')\/1(h|')\/0(h|')\]tpub[a-zA-Z0-9]{107}\/0\/\*\)#[a-z0-9]{8}$"
regex_tr_cd = r"^tr\(\[[a-f0-9]{8}\/86(h|')\/1(h|')\/0(h|')\]tpub[a-zA-Z0-9]{107}\/1\/\*\)#[a-z0-9]{8}$"
assert re.search(regex_ns_d, smaug_wallet_1["descriptor"]) is not None
assert re.search(regex_ns_cd, smaug_wallet_1["change_descriptor"]) is not None
assert smaug_wallet_1["birthday"] == 821000
Expand Down

0 comments on commit 79bf7c5

Please sign in to comment.