Merge 790c509a4796ec47be2275d86b35370ff25a599a into 5f4422d68dc3530c353af1f87499de1c864b60ad

This commit is contained in:
hodlinator 2025-03-17 03:52:54 +01:00 committed by GitHub
commit c5e13ddf2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -69,6 +69,14 @@ def summarise_dict_differences(thing1, thing2):
d2[k] = thing2[k]
return d1, d2
def assert_true(condition: bool) -> None:
"""Separate from the `assert` keyword in that it should not be optimized out
when environment var `PYTHONOPTIMIZE=1`, or Python is run with `-O`."""
if not condition:
raise AssertionError
def assert_equal(thing1, thing2, *args):
if thing1 != thing2 and not args and isinstance(thing1, dict) and isinstance(thing2, dict):
d1,d2 = summarise_dict_differences(thing1, thing2)

View File

@ -11,6 +11,7 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_true,
)
@ -68,7 +69,7 @@ class WalletMultisigDescriptorPSBTTest(BitcoinTestFramework):
"timestamp": "now",
},
])
assert all(r["success"] for r in result)
assert_true(all(r["success"] for r in result))
yield multisig
def run_test(self):
@ -95,9 +96,9 @@ class WalletMultisigDescriptorPSBTTest(BitcoinTestFramework):
self.log.info("Check that every participant's multisig generates the same addresses...")
for _ in range(10): # we check that the first 10 generated addresses are the same for all participant's multisigs
receive_addresses = [multisig.getnewaddress() for multisig in participants["multisigs"]]
all(address == receive_addresses[0] for address in receive_addresses)
assert_true(all(address == receive_addresses[0] for address in receive_addresses))
change_addresses = [multisig.getrawchangeaddress() for multisig in participants["multisigs"]]
all(address == change_addresses[0] for address in change_addresses)
assert_true(all(address == change_addresses[0] for address in change_addresses))
self.log.info("Get a mature utxo to send to the multisig...")
coordinator_wallet = participants["signers"][0]