Merge pull request #2538 from ReverseControl/deepsource-fix-9833b18c
Deepsource Fix: Comprehension not required. Allow evaluation short-circuiting.
This commit is contained in:
commit
152e7b3633
|
@ -614,7 +614,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
if best_hash.count(best_hash[0]) == len(rpc_connections):
|
||||
return
|
||||
# Check that each peer has at least one connection
|
||||
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
|
||||
assert (all(len(x.getpeerinfo()) for x in rpc_connections))
|
||||
time.sleep(wait)
|
||||
raise AssertionError("Block sync timed out after {}s:{}".format(
|
||||
timeout,
|
||||
|
@ -637,7 +637,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||
r.syncwithvalidationinterfacequeue()
|
||||
return
|
||||
# Check that each peer has at least one connection
|
||||
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
|
||||
assert (all(len(x.getpeerinfo()) for x in rpc_connections))
|
||||
time.sleep(wait)
|
||||
raise AssertionError("Mempool sync timed out after {}s:{}".format(
|
||||
timeout,
|
||||
|
|
|
@ -535,7 +535,7 @@ def find_vout_for_address(node, txid, addr):
|
|||
"""
|
||||
tx = node.getrawtransaction(txid, True)
|
||||
for i in range(len(tx["vout"])):
|
||||
if any([addr == a for a in tx["vout"][i]["scriptPubKey"]["addresses"]]):
|
||||
if any(addr == a for a in tx["vout"][i]["scriptPubKey"]["addresses"]):
|
||||
return i
|
||||
raise RuntimeError("Vout not found for address: txid=%s, addr=%s" % (txid, addr))
|
||||
|
||||
|
|
Loading…
Reference in a new issue