From 7bc411eb985c00452af2808cd7d0c8b514a5361b Mon Sep 17 00:00:00 2001 From: tecnovert Date: Mon, 21 Nov 2022 13:04:11 +0200 Subject: [PATCH] tests: Call reservebalance to trigger WakeThreadStakeMiner Node 0 needs a short advantage to stake the first few blocks to avoid prevout-not-found errors. --- tests/basicswap/extended/test_dash.py | 2 ++ tests/basicswap/extended/test_network.py | 1 + tests/basicswap/extended/test_nmc.py | 2 ++ tests/basicswap/extended/test_pivx.py | 2 ++ tests/basicswap/test_xmr.py | 1 + 5 files changed, 8 insertions(+) diff --git a/tests/basicswap/extended/test_dash.py b/tests/basicswap/extended/test_dash.py index 9fc97b4..272ad52 100644 --- a/tests/basicswap/extended/test_dash.py +++ b/tests/basicswap/extended/test_dash.py @@ -305,6 +305,8 @@ class Test(unittest.TestCase): rpc('rescanblockchain') else: rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']]) + rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}]) + rpc('reservebalance', [False]) basicswap_dir = os.path.join(os.path.join(cfg.TEST_DATADIRS, str(i)), 'basicswap') settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME) diff --git a/tests/basicswap/extended/test_network.py b/tests/basicswap/extended/test_network.py index b5e2842..9da32d5 100644 --- a/tests/basicswap/extended/test_network.py +++ b/tests/basicswap/extended/test_network.py @@ -221,6 +221,7 @@ class Test(unittest.TestCase): rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']]) # Lower output split threshold for more stakeable outputs rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}]) + rpc('reservebalance', [False]) for i in range(NUM_BTC_NODES): data_dir = prepareDataDir(TEST_DIR, i, 'bitcoin.conf', 'btc_', base_p2p_port=BTC_BASE_PORT, base_rpc_port=BTC_BASE_RPC_PORT) diff --git a/tests/basicswap/extended/test_nmc.py b/tests/basicswap/extended/test_nmc.py index 3ce8742..fb0efdf 100644 --- a/tests/basicswap/extended/test_nmc.py +++ b/tests/basicswap/extended/test_nmc.py @@ -297,6 +297,8 @@ class Test(unittest.TestCase): rpc('rescanblockchain') else: rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']]) + rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}]) + rpc('reservebalance', [False]) basicswap_dir = os.path.join(os.path.join(cfg.TEST_DATADIRS, str(i)), 'basicswap') settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME) diff --git a/tests/basicswap/extended/test_pivx.py b/tests/basicswap/extended/test_pivx.py index a288bbc..383281a 100644 --- a/tests/basicswap/extended/test_pivx.py +++ b/tests/basicswap/extended/test_pivx.py @@ -317,6 +317,8 @@ class Test(unittest.TestCase): rpc('rescanblockchain') else: rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']]) + rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}]) + rpc('reservebalance', [False]) basicswap_dir = os.path.join(os.path.join(cfg.TEST_DATADIRS, str(i)), 'basicswap') settings_path = os.path.join(basicswap_dir, cfg.CONFIG_FILENAME) diff --git a/tests/basicswap/test_xmr.py b/tests/basicswap/test_xmr.py index 4ff6204..fe85b5a 100644 --- a/tests/basicswap/test_xmr.py +++ b/tests/basicswap/test_xmr.py @@ -395,6 +395,7 @@ class BaseTest(unittest.TestCase): rpc('extkeyimportmaster', [rpc('mnemonic', ['new'])['master']]) # Lower output split threshold for more stakeable outputs rpc('walletsettings', ['stakingoptions', {'stakecombinethreshold': 100, 'stakesplitthreshold': 200}]) + rpc('reservebalance', [False]) for i in range(NUM_BTC_NODES): if not cls.restore_instance: