From b8fd4ad85b5d05a8c69455a17a43dccad1f97c03 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Mon, 1 Nov 2021 22:57:27 +0200 Subject: [PATCH] ui: Enable Particl CT and RCT to XMR swaps. --- basicswap/http_server.py | 9 +++++---- basicswap/interface_part.py | 6 ++++++ basicswap/interface_xmr.py | 5 +++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/basicswap/http_server.py b/basicswap/http_server.py index a48fb60..93fae8d 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -66,8 +66,10 @@ def value_or_none(v): def getCoinName(c): - if c == Coins.PART_ANON or c == Coins.PART_BLIND: + if c == Coins.PART_ANON: return chainparams[Coins.PART]['name'].capitalize() + 'Anon' + if c == Coins.PART_BLIND: + return chainparams[Coins.PART]['name'].capitalize() + 'Blind' return chainparams[c]['name'].capitalize() @@ -79,9 +81,8 @@ def listAvailableCoins(swap_client): if v['connection_type'] == 'rpc': coins.append((int(k), getCoinName(k))) if k == Coins.PART: - pass - # TODO: Uncomment - # coins.append((int(Coins.PART_ANON), getCoinName(k))) + coins.append((int(Coins.PART_ANON), getCoinName(Coins.PART_ANON))) + coins.append((int(Coins.PART_BLIND), getCoinName(Coins.PART_BLIND))) return coins diff --git a/basicswap/interface_part.py b/basicswap/interface_part.py index 2ab0fea..248f5b1 100644 --- a/basicswap/interface_part.py +++ b/basicswap/interface_part.py @@ -116,6 +116,9 @@ class PARTInterfaceBlind(PARTInterface): def balance_type(): return BalanceTypes.BLIND + def coin_name(self): + return super().coin_name() + ' Blind' + def encodeSegwitP2WSH(self, p2wsh): return segwit_addr.encode(self.chainparams_network()['hrp'], 0, p2wsh[2:]) @@ -608,6 +611,9 @@ class PARTInterfaceAnon(PARTInterface): def balance_type(): return BalanceTypes.ANON + def coin_name(self): + return super().coin_name() + ' Anon' + def publishBLockTx(self, Kbv, Kbs, output_amount, feerate): sx_addr = self.formatStealthAddress(Kbv, Kbs) self._log.debug('sx_addr: {}'.format(sx_addr)) diff --git a/basicswap/interface_xmr.py b/basicswap/interface_xmr.py index 8d69eaf..4451974 100644 --- a/basicswap/interface_xmr.py +++ b/basicswap/interface_xmr.py @@ -120,8 +120,9 @@ class XMRInterface(CoinInterface): # rv['blocks'] = self.rpc_cb('get_block_count')['count'] rv['blocks'] = self.rpc_cb2('get_height', timeout=30)['height'] - sync_info = self.rpc_cb('sync_info', timeout=30) - rv['verificationprogress'] = 0.0 if 'spans' in sync_info else 1.0 + # sync_info = self.rpc_cb('sync_info', timeout=30) + # rv['verificationprogress'] = 0.0 if 'spans' in sync_info else 1.0 + rv['verificationprogress'] = 0.0 return rv