trivial: Fix lint issues.
Some checks failed
lint / build (3.12) (push) Has been cancelled

This commit is contained in:
tecnovert 2024-11-27 08:49:08 +02:00
parent 25cfcc7cee
commit 31ead537c9
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
4 changed files with 17 additions and 11 deletions

View file

@ -1002,8 +1002,10 @@ class BasicSwap(BaseApp):
elif c in (Coins.XMR, Coins.WOW): elif c in (Coins.XMR, Coins.WOW):
try: try:
ci.ensureWalletExists() ci.ensureWalletExists()
except Exception as e: except Exception as e: # noqa: F841
self.log.warning("Can't open %s wallet, could be locked.", ci.coin_name()) self.log.warning(
"Can't open %s wallet, could be locked.", ci.coin_name()
)
continue continue
elif c == Coins.LTC: elif c == Coins.LTC:
ci_mweb = self.ci(Coins.LTC_MWEB) ci_mweb = self.ci(Coins.LTC_MWEB)

View file

@ -172,7 +172,9 @@ class PARTInterface(BTCInterface):
elif balance_type == BalanceTypes.BLIND: elif balance_type == BalanceTypes.BLIND:
unspent = self.rpc_wallet("listunspentblind") unspent = self.rpc_wallet("listunspentblind")
else: else:
raise ValueError(f"getUnspentsByAddr not implemented for {balance_type} type") raise ValueError(
f"getUnspentsByAddr not implemented for {balance_type} type"
)
for u in unspent: for u in unspent:
if u["spendable"] is not True: if u["spendable"] is not True:
continue continue

View file

@ -114,7 +114,9 @@ class XMRInterface(CoinInterface):
log_str: str = "" log_str: str = ""
have_cc_tor_opt = "use_tor" in chain_client_settings have_cc_tor_opt = "use_tor" in chain_client_settings
if have_cc_tor_opt and chain_client_settings["use_tor"] is False: if have_cc_tor_opt and chain_client_settings["use_tor"] is False:
log_str = f" bypassing proxy (use_tor false for {self.coin_name()})" log_str = (
f" bypassing proxy (use_tor false for {self.coin_name()})"
)
elif have_cc_tor_opt is False and is_private_ip_address(rpchost): elif have_cc_tor_opt is False and is_private_ip_address(rpchost):
log_str = " bypassing proxy (private ip address)" log_str = " bypassing proxy (private ip address)"
else: else:
@ -196,7 +198,7 @@ class XMRInterface(CoinInterface):
self.rpc_wallet("store") self.rpc_wallet("store")
self.rpc_wallet("close_wallet") self.rpc_wallet("close_wallet")
self._log.debug(f"Attempt to save and close {self.coin_name()} wallet") self._log.debug(f"Attempt to save and close {self.coin_name()} wallet")
except Exception as e: except Exception as e: # noqa: F841
pass pass
self.rpc_wallet("open_wallet", params) self.rpc_wallet("open_wallet", params)

View file

@ -375,7 +375,7 @@ def main():
"wallets/{}".format(coin_from_data["ticker"]) "wallets/{}".format(coin_from_data["ticker"])
) )
coin_ticker = coin_from_data["ticker"] coin_ticker = coin_from_data["ticker"]
if coin_ticker=="PART" and "variant" in coin_from_data: if coin_ticker == "PART" and "variant" in coin_from_data:
coin_variant = coin_from_data["variant"] coin_variant = coin_from_data["variant"]
if coin_variant == "Anon": if coin_variant == "Anon":
coin_from_data_name = "PART_ANON" coin_from_data_name = "PART_ANON"
@ -384,7 +384,9 @@ def main():
coin_from_data_name = "PART_BLIND" coin_from_data_name = "PART_BLIND"
wallet_balance: float = float(wallet_from["blind_balance"]) wallet_balance: float = float(wallet_from["blind_balance"])
else: else:
raise ValueError(f"{coin_ticker} variant {coin_variant} not handled") raise ValueError(
f"{coin_ticker} variant {coin_variant} not handled"
)
else: else:
coin_from_data_name = coin_ticker coin_from_data_name = coin_ticker
wallet_balance: float = float(wallet_from["balance"]) wallet_balance: float = float(wallet_from["balance"])
@ -404,9 +406,7 @@ def main():
None, None,
): ):
offers_found += 1 offers_found += 1
if wallet_balance <= float( if wallet_balance <= float(offer_template["min_coin_from_amt"]):
offer_template["min_coin_from_amt"]
):
offer_id = offer["offer_id"] offer_id = offer["offer_id"]
print( print(
"Revoking offer {}, wallet from balance below minimum".format( "Revoking offer {}, wallet from balance below minimum".format(