ruff SIM103 (return the negated condition directly)

This commit is contained in:
The MMGen Project 2026-08-07 09:37:47 +00:00
commit 28e06ae168
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 9 additions and 14 deletions

View file

@ -406,10 +406,7 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit):
except:
pass
if self.cfg.test_suite and not self.chain == 'regtest':
return True
return False
return self.cfg.test_suite and not self.chain == 'regtest'
return locals()[info_id]()

View file

@ -30,9 +30,7 @@ class Completed:
def check_sigs(self): # TODO
from ....util import is_hex_str
if is_hex_str(self.serialized):
return True
return False
return is_hex_str(self.serialized)
def check_pubkey_scripts(self):
pass

View file

@ -106,12 +106,13 @@ class wallet(wallet):
msg(f'Incorrect master checksum ({lines[0]}) in {desc} data')
return False
chk = make_chksum_6(' '.join(lines[1:]))
if not self.cfg._util.compare_chksums(lines[0], 'master', chk, 'computed',
hdr='For wallet master checksum', verbose=True):
return False
return True
return self.cfg._util.compare_chksums(
lines[0],
'master',
make_chksum_6(' '.join(lines[1:])),
'computed',
hdr = 'For wallet master checksum',
verbose = True)
lines = self.fmt_data.splitlines()
if not check_master_chksum(lines, self.desc):

View file

@ -34,7 +34,6 @@ ignore = [
"S102", # Use of `exec` detected
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM103", # Return the negated condition directly
"SIM114", # Combine `if` branches using logical `or` operator
"SIM115", # Use a context manager for opening files
"SIM118", # Use `key in dict` instead of `key in dict.keys()`