1
0

tests: set low wallet.gap_limit_for_change to speed up tests

This commit is contained in:
SomberNight
2025-08-08 16:24:50 +00:00
parent 4800a2d9c6
commit 4f1cc8b9cb
9 changed files with 141 additions and 112 deletions

View File

@@ -4,12 +4,14 @@ import unittest
import threading
import tempfile
import shutil
import functools
import electrum
import electrum.logging
from electrum import constants
from electrum import util
from electrum.logging import Logger
from electrum.wallet import restore_wallet_from_text
# Set this locally to make the test suite run faster.
@@ -92,3 +94,14 @@ def as_testnet(func):
finally:
constants.net = old_net
return run_test
@functools.wraps(restore_wallet_from_text)
def restore_wallet_from_text__for_unittest(*args, gap_limit=2, gap_limit_for_change=1, **kwargs):
"""much lower default gap limits (to save compute time)"""
return restore_wallet_from_text(
*args,
gap_limit=gap_limit,
gap_limit_for_change=gap_limit_for_change,
**kwargs,
)