This commit is contained in:
2026-05-04 16:28:17 +02:00
parent 7d433d0b44
commit eef498a4da
5 changed files with 14 additions and 6 deletions
+2 -2
View File
@@ -57,9 +57,9 @@ class TestBlockchain(ElectrumTestCase):
def setUp(self):
super().setUp()
self.data_dir = self.electrum_path
self.config = SimpleConfig({'electrum_path': self.electrum_path})
self.data_dir = self.config.path
make_dir(os.path.join(self.data_dir, 'forks'))
self.config = SimpleConfig({'electrum_path': self.data_dir})
blockchain.blockchains = {}
def _append_header(self, chain: Blockchain, header: dict):
+1 -1
View File
@@ -197,7 +197,7 @@ class TestCommandsTestnet(ElectrumTestCase):
super().setUp()
self.config = SimpleConfig({'electrum_path': self.electrum_path})
self.config.NETWORK_OFFLINE = True
shutil.copytree(os.path.join(os.path.dirname(__file__), "fiat_fx_data"), os.path.join(self.electrum_path, "cache"))
shutil.copytree(os.path.join(os.path.dirname(__file__), "fiat_fx_data"), os.path.join(self.config.path, "cache"))
self.config.FX_EXCHANGE = "BitFinex"
self.config.FX_CURRENCY = "EUR"
self._default_default_timezone = electrum.util.DEFAULT_TIMEZONE
+9 -1
View File
@@ -1656,8 +1656,16 @@ class TestPeerDirect(TestPeer):
min_final_cltv_delta=400,
payment_secret=lnaddr1.payment_secret,
)
await asyncio.sleep(bob_wallet.MPP_EXPIRY // 2) # give bob time to receive the htlc
bob_payment_key = bob_wallet._get_payment_key(lnaddr1.paymenthash).hex()
# wait until bob has received both HTLCs (anchor channels need more commitment round-trips)
deadline = time.monotonic() + bob_wallet.MPP_EXPIRY * 2
while True:
mpp_set = bob_wallet.received_mpp_htlcs.get(bob_payment_key)
if mpp_set is not None and len(mpp_set.htlcs) >= 2:
break
if time.monotonic() > deadline:
self.fail(f"timed out waiting for bob to receive both HTLCs: {bob_wallet.received_mpp_htlcs=}")
await asyncio.sleep(0.05)
assert bob_wallet.received_mpp_htlcs[bob_payment_key].resolution == RecvMPPResolution.WAITING
assert len(bob_wallet.received_mpp_htlcs[bob_payment_key].htlcs) == 2
# now wait until bob expires the mpp (set)
+1 -1
View File
@@ -107,7 +107,7 @@ class Test_SimpleConfig(ElectrumTestCase):
read_user_dir_function=read_user_dir)
config.save_user_config()
contents = None
with open(os.path.join(self.electrum_dir, "config"), "r") as f:
with open(os.path.join(config.path, "config"), "r") as f:
contents = f.read()
result = ast.literal_eval(contents)
result.pop('config_version', None)
+1 -1
View File
@@ -225,8 +225,8 @@ class TestHistoryExport(ElectrumTestCase):
self.patch_timezone.start()
time.tzset()
super(TestHistoryExport, self).setUp()
shutil.copytree(Path(__file__).parent / "fiat_fx_data", Path(self.electrum_path) / "cache")
self.config = SimpleConfig({'electrum_path': self.electrum_path})
shutil.copytree(Path(__file__).parent / "fiat_fx_data", Path(self.config.path) / "cache")
def tearDown(self):
super(TestHistoryExport, self).tearDown()