Add anon and blind Particl to validateSwapType

This commit is contained in:
tecnovert 2021-12-10 09:50:36 +02:00
parent 4b7b16145f
commit d51de1f680
No known key found for this signature in database
GPG Key ID: 8ED6D8750C4E3F93

View File

@ -938,9 +938,15 @@ class BasicSwap(BaseApp):
def validateSwapType(self, coin_from, coin_to, swap_type): def validateSwapType(self, coin_from, coin_to, swap_type):
if coin_from == Coins.XMR: if coin_from == Coins.XMR:
raise ValueError('TODO: xmr coin_from') raise ValueError('TODO: XMR coin_from')
if coin_to == Coins.XMR and swap_type != SwapTypes.XMR_SWAP: if coin_to == Coins.XMR and swap_type != SwapTypes.XMR_SWAP:
raise ValueError('Invalid swap type for XMR') raise ValueError('Invalid swap type for XMR')
if coin_from == Coins.PART_ANON:
raise ValueError('TODO: PART_ANON coin_from')
if coin_to == Coins.PART_ANON and swap_type != SwapTypes.XMR_SWAP:
raise ValueError('Invalid swap type for PART_ANON')
if (coin_from == Coins.PART_BLIND or coin_to == Coins.PART_BLIND) and swap_type != SwapTypes.XMR_SWAP:
raise ValueError('Invalid swap type for PART_BLIND')
def validateOfferAmounts(self, coin_from, coin_to, amount, rate, min_bid_amount): def validateOfferAmounts(self, coin_from, coin_to, amount, rate, min_bid_amount):
ci_from = self.ci(coin_from) ci_from = self.ci(coin_from)
@ -5575,7 +5581,7 @@ class BasicSwap(BaseApp):
rv = [] rv = []
for a in addresses: for a in addresses:
v = session.query(KnownIdentity).filter_by(address=a).first() v = session.query(KnownIdentity).filter_by(address=a).first()
rv.append('' if not v else v.label) rv.append('' if (not v or not v.label) else v.label)
return rv return rv
finally: finally:
session.close() session.close()