Fix BCH exchange name, pipe daemon output to file from prepare.

This commit is contained in:
tecnovert 2024-11-13 19:02:46 +02:00
parent 4693d96c52
commit 811fa15f26
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
4 changed files with 11 additions and 8 deletions

View file

@ -1327,9 +1327,10 @@ def test_particl_encryption(data_dir, settings, chain, use_tor_proxy):
coin_name = 'particl'
coin_settings = settings['chainclients'][coin_name]
daemon_args += getCoreBinArgs(c, coin_settings)
extra_config = {'stdout_to_file': True}
if coin_settings['manage_daemon']:
filename: str = getCoreBinName(c, coin_settings, coin_name + 'd')
daemons.append(startDaemon(coin_settings['datadir'], coin_settings['bindir'], filename, daemon_args))
daemons.append(startDaemon(coin_settings['datadir'], coin_settings['bindir'], filename, daemon_args, extra_config=extra_config))
swap_client.setDaemonPID(c, daemons[-1].handle.pid)
swap_client.setCoinRunParams(c)
swap_client.createCoinInterface(c)
@ -1396,7 +1397,8 @@ def initialise_wallets(particl_wallet_mnemonic, with_coins, data_dir, settings,
if c == Coins.FIRO:
coin_args += ['-hdseed={}'.format(swap_client.getWalletKey(Coins.FIRO, 1).hex())]
daemons.append(startDaemon(coin_settings['datadir'], coin_settings['bindir'], filename, daemon_args + coin_args))
extra_config = {'stdout_to_file': True}
daemons.append(startDaemon(coin_settings['datadir'], coin_settings['bindir'], filename, daemon_args + coin_args, extra_config=extra_config))
swap_client.setDaemonPID(c, daemons[-1].handle.pid)
swap_client.setCoinRunParams(c)
swap_client.createCoinInterface(c)

View file

@ -92,10 +92,11 @@ def startDaemon(node_dir, bin_dir, daemon_bin, opts=[], extra_config={}):
stdout_dest = subprocess.PIPE
stderr_dest = subprocess.PIPE
shell: bool = False
if extra_config.get('use_shell', False):
str_args = ' '.join(args)
return Daemon(subprocess.Popen(str_args, shell=True, stdin=subprocess.PIPE, stdout=stdout_dest, stderr=stderr_dest, cwd=datadir_path), opened_files)
return Daemon(subprocess.Popen(args, stdin=subprocess.PIPE, stdout=stdout_dest, stderr=stderr_dest, cwd=datadir_path), opened_files)
args = ' '.join(args)
shell = True
return Daemon(subprocess.Popen(args, shell=shell, stdin=subprocess.PIPE, stdout=stdout_dest, stderr=stderr_dest, cwd=datadir_path), opened_files)
def startXmrDaemon(node_dir, bin_dir, daemon_bin, opts=[]):

View file

@ -82,8 +82,8 @@ class BCHInterface(BTCInterface):
# bch does not have segwit, but we return true here to avoid extra checks in basicswap.py
return True
def getExchangeName(self, exchange_name):
return 'bch'
def getExchangeName(self, exchange_name: str) -> str:
return 'bitcoin-cash'
def getNewAddress(self, use_segwit: bool = False, label: str = 'swap_receive') -> str:
args = [label]

View file

@ -42,7 +42,7 @@ class FIROInterface(BTCInterface):
# No multiwallet support
self.rpc_wallet = make_rpc_func(self._rpcport, self._rpcauth, host=self._rpc_host)
def getExchangeName(self, exchange_name):
def getExchangeName(self, exchange_name: str) -> str:
return 'zcoin'
def initialiseWallet(self, key):