tests: simplify the MultiSigner

This commit is contained in:
Antoine Poinsot 2023-03-28 15:22:57 +02:00
parent 75ea367235
commit 3aa9980635
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304
2 changed files with 4 additions and 6 deletions

View File

@ -163,11 +163,11 @@ def lianad_multisig(bitcoind, directory):
bitcoind_cookie = os.path.join(bitcoind.bitcoin_dir, "regtest", ".cookie")
# A 3-of-4 that degrades into a 2-of-5 after 10 blocks
signer = MultiSigner(3, 4, 2, 5)
signer = MultiSigner(4, 5)
csv_value = 10
prim_multi, recov_multi = (
multi_expression(signer.prim_thresh, signer.prim_hds),
multi_expression(signer.recov_thresh, signer.recov_hds),
multi_expression(3, signer.prim_hds),
multi_expression(2, signer.recov_hds),
)
main_desc = Descriptor.from_str(
f"wsh(or_d({prim_multi},and_v(v:{recov_multi},older({csv_value}))))"

View File

@ -77,14 +77,12 @@ class SingleSigner:
class MultiSigner:
def __init__(
self, primary_thresh, primary_hds_count, recovery_thresh, recovery_hds_count
self, primary_hds_count, recovery_hds_count
):
self.prim_thresh = primary_thresh
self.prim_hds = [
BIP32.from_seed(os.urandom(32), network="test")
for _ in range(primary_hds_count)
]
self.recov_thresh = recovery_thresh
self.recov_hds = [
BIP32.from_seed(os.urandom(32), network="test")
for _ in range(recovery_hds_count)