ui: Enable Particl CT and RCT to XMR swaps.
This commit is contained in:
		
							parent
							
								
									965db389f6
								
							
						
					
					
						commit
						b8fd4ad85b
					
				@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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))
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user