From 04d4d89e96f605300eb21d16bec6c07f1beb3c9c Mon Sep 17 00:00:00 2001 From: tecnovert Date: Sun, 18 Jun 2023 22:00:27 +0200 Subject: [PATCH] coins: Update DASH version. See https://github.com/dashpay/dash/releases/tag/v19.1.0 When upgrading from a version < 19.0, a migration process will occur. It's recommended to start the DASH node manually to complete the migration and get on the correct chain. --- bin/basicswap_prepare.py | 4 ++-- tests/basicswap/extended/test_dash.py | 28 +++++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index 96372c6..cecd735 100755 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -55,7 +55,7 @@ XMR_SITE_COMMIT = 'a3b195eb90c7d5564cc9d9ec09c873783d21901b' # Lock hashes.txt PIVX_VERSION = os.getenv('PIVX_VERSION', '5.5.0') PIVX_VERSION_TAG = os.getenv('PIVX_VERSION_TAG', '') -DASH_VERSION = os.getenv('DASH_VERSION', '18.1.0') +DASH_VERSION = os.getenv('DASH_VERSION', '19.1.0') DASH_VERSION_TAG = os.getenv('DASH_VERSION_TAG', '') FIRO_VERSION = os.getenv('FIRO_VERSION', '0.14.99.1') @@ -1094,7 +1094,7 @@ def initialise_wallets(particl_wallet_mnemonic, with_coins, data_dir, settings, try: swap_client = BasicSwap(fp, data_dir, settings, chain) - coins_to_create_wallets_for = (Coins.PART, Coins.BTC, Coins.LTC) + coins_to_create_wallets_for = (Coins.PART, Coins.BTC, Coins.LTC, Coins.DASH) # Always start Particl, it must be running to initialise a wallet in addcoin mode # Particl must be loaded first as subsequent coins are initialised from the Particl mnemonic start_daemons = ['particl', ] + [c for c in with_coins if c != 'particl'] diff --git a/tests/basicswap/extended/test_dash.py b/tests/basicswap/extended/test_dash.py index 6e6b541..69e3dfb 100644 --- a/tests/basicswap/extended/test_dash.py +++ b/tests/basicswap/extended/test_dash.py @@ -287,13 +287,23 @@ class Test(unittest.TestCase): btc_data_dir = os.path.join(cfg.TEST_DATADIRS, str(BTC_NODE)) if os.path.exists(os.path.join(cfg.BITCOIN_BINDIR, 'bitcoin-wallet')): + logging.info('Creating BTC wallet.') try: callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat -legacy create', 'bitcoin-wallet') except Exception: callrpc_cli(cfg.BITCOIN_BINDIR, btc_data_dir, 'regtest', '-wallet=wallet.dat create', 'bitcoin-wallet') cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND)) logging.info('Started %s %d', cfg.BITCOIND, cls.daemons[-1].pid) - cls.daemons.append(startDaemon(os.path.join(cfg.TEST_DATADIRS, str(DASH_NODE)), cfg.DASH_BINDIR, cfg.DASHD)) + + dash_data_dir = os.path.join(cfg.TEST_DATADIRS, str(DASH_NODE)) + ''' + dash-wallet does not seem to create valid wallet files. + + if os.path.exists(os.path.join(cfg.DASH_BINDIR, 'dash-wallet')): + logging.info('Creating DASH wallet.') + callrpc_cli(cfg.DASH_BINDIR, dash_data_dir, 'regtest', '-wallet=wallet.dat create', 'dash-wallet') + ''' + cls.daemons.append(startDaemon(dash_data_dir, cfg.DASH_BINDIR, cfg.DASHD)) logging.info('Started %s %d', cfg.DASHD, cls.daemons[-1].pid) for i in range(NUM_NODES): @@ -326,12 +336,18 @@ class Test(unittest.TestCase): settings = json.load(fs) fp = open(os.path.join(basicswap_dir, 'basicswap.log'), 'w') cls.swap_clients.append(BasicSwap(fp, basicswap_dir, settings, 'regtest', log_name='BasicSwap{}'.format(i))) - cls.swap_clients[-1].setDaemonPID(Coins.BTC, cls.daemons[0].pid) - cls.swap_clients[-1].setDaemonPID(Coins.DASH, cls.daemons[1].pid) - cls.swap_clients[-1].setDaemonPID(Coins.PART, cls.daemons[2 + i].pid) - cls.swap_clients[-1].start() + swap_client = cls.swap_clients[-1] + swap_client.setDaemonPID(Coins.BTC, cls.daemons[0].pid) + swap_client.setDaemonPID(Coins.DASH, cls.daemons[1].pid) + swap_client.setDaemonPID(Coins.PART, cls.daemons[2 + i].pid) - t = HttpThread(cls.swap_clients[i].fp, TEST_HTTP_HOST, TEST_HTTP_PORT + i, False, cls.swap_clients[i]) + waitForRPC(dashRpc, expect_wallet=False) + if len(dashRpc('listwallets')) < 1: + dashRpc('createwallet wallet.dat') + + swap_client.start() + + t = HttpThread(cls.swap_clients[i].fp, TEST_HTTP_HOST, TEST_HTTP_PORT + i, False, swap_client) cls.http_threads.append(t) t.start()