diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index 83010b9b0057..8936b34bfb6b 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -34,7 +34,7 @@ python3 --version # NOTE: BUMP ALSO contrib/containers/ci/ci-slim.Dockerfile ${CI_RETRY_EXE} pip3 install \ codespell==2.2.1 \ - flake8==5.0.4 \ + flake8==6.1.0 \ lief==0.13.2 \ mypy==0.981 \ pyzmq==24.0.1 \ diff --git a/contrib/containers/ci/ci-slim.Dockerfile b/contrib/containers/ci/ci-slim.Dockerfile index 73c864983939..eedc49b5d7b6 100644 --- a/contrib/containers/ci/ci-slim.Dockerfile +++ b/contrib/containers/ci/ci-slim.Dockerfile @@ -78,7 +78,7 @@ ENV UV_SYSTEM_PYTHON=1 # NOTE: if versions are changed, update ci/lint/04_install.sh RUN uv pip install --system --break-system-packages \ codespell==2.2.1 \ - flake8==5.0.4 \ + flake8==6.1.0 \ jinja2 \ lief==0.13.2 \ mypy==0.981 \ diff --git a/src/test/fuzz/descriptor_parse.cpp b/src/test/fuzz/descriptor_parse.cpp index 1084c569a703..f93b9b4223c0 100644 --- a/src/test/fuzz/descriptor_parse.cpp +++ b/src/test/fuzz/descriptor_parse.cpp @@ -82,7 +82,7 @@ class MockedDescriptorConverter { std::string desc; desc.reserve(mocked_desc.size()); - // Replace all occurences of '%' followed by two hex characters with the corresponding key. + // Replace all occurrences of '%' followed by two hex characters with the corresponding key. for (size_t i = 0; i < mocked_desc.size();) { if (mocked_desc[i] == '%') { if (i + 3 >= mocked_desc.size()) return {}; diff --git a/test/functional/feature_governance.py b/test/functional/feature_governance.py index f319fd180d9c..4be122f54648 100755 --- a/test/functional/feature_governance.py +++ b/test/functional/feature_governance.py @@ -9,7 +9,6 @@ from test_framework.messages import uint256_to_string from test_framework.test_framework import ( DashTestFramework, - MasternodeInfo, ) from test_framework.governance import have_trigger_for_height, prepare_object from test_framework.util import assert_equal, satoshi_round @@ -195,7 +194,7 @@ def run_test(self): _, mn_payee_protx = height_protx_list[1] payee_idx = None - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: if mn.proTxHash == mn_payee_protx: payee_idx = mn.nodeIdx break diff --git a/test/functional/feature_llmq_connections.py b/test/functional/feature_llmq_connections.py index 9b7955f6b2b5..2a63b912f877 100755 --- a/test/functional/feature_llmq_connections.py +++ b/test/functional/feature_llmq_connections.py @@ -14,7 +14,6 @@ from test_framework.test_framework import ( DashTestFramework, - MasternodeInfo, ) from test_framework.util import assert_greater_than_or_equal @@ -86,7 +85,7 @@ def run_test(self): self.log.info("check that old masternode connections are dropped") removed = False - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: if len(mn.get_node(self).quorum("memberof", mn.proTxHash)) > 0: try: with mn.get_node(self).assert_debug_log(['removing masternodes quorum connections']): @@ -102,7 +101,7 @@ def run_test(self): self.log.info("check that inter-quorum masternode connections are added") added = False - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: if len(mn.get_node(self).quorum("memberof", mn.proTxHash)) > 0: try: with mn.get_node(self).assert_debug_log(['adding mn inter-quorum connections']): @@ -116,11 +115,11 @@ def run_test(self): def check_reconnects(self, expected_connection_count): self.log.info("disable and re-enable networking on all masternodes") - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: mn.get_node(self).setnetworkactive(False) - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: self.wait_until(lambda: len(mn.get_node(self).getpeerinfo()) == 0) - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: mn.get_node(self).setnetworkactive(True) self.bump_mocktime(60) diff --git a/test/functional/feature_llmq_singlenode.py b/test/functional/feature_llmq_singlenode.py index 4e7040b85994..0238ddced9b2 100755 --- a/test/functional/feature_llmq_singlenode.py +++ b/test/functional/feature_llmq_singlenode.py @@ -14,7 +14,6 @@ from test_framework.authproxy import JSONRPCException from test_framework.test_framework import ( DashTestFramework, - MasternodeInfo, ) from test_framework.util import ( assert_raises_rpc_error, @@ -43,7 +42,7 @@ def check_sigs(self, hasrecsigs, isconflicting1, isconflicting2): conflicting_1 = False conflicting_2 = False - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: if mn.get_node(self).quorum("hasrecsig", q_type, id, msgHash): has_sig = True if mn.get_node(self).quorum("isconflicting", q_type, id, msgHash): diff --git a/test/functional/feature_mnehf.py b/test/functional/feature_mnehf.py index 47e95df78f42..740ce21fa4ca 100755 --- a/test/functional/feature_mnehf.py +++ b/test/functional/feature_mnehf.py @@ -18,7 +18,6 @@ from test_framework.test_framework import ( DashTestFramework, - MasternodeInfo ) from test_framework.util import ( assert_equal, @@ -44,7 +43,7 @@ def restart_all_nodes(self, params=None): self.log.info(f"Actual restart options: {self.extra_args[inode]}") self.restart_node(0) - for mn in self.mninfo: # type: MasternodeInfo + for mn in self.mninfo: index = mn.nodeIdx self.stop_node(index) self.start_masternode(mn) diff --git a/test/functional/interface_zmq_dash.py b/test/functional/interface_zmq_dash.py index 212d6002ea1d..9fd7854aa636 100755 --- a/test/functional/interface_zmq_dash.py +++ b/test/functional/interface_zmq_dash.py @@ -14,7 +14,6 @@ from test_framework.test_framework import ( DashTestFramework, - MasternodeInfo, ) from test_framework.p2p import P2PInterface from test_framework.util import ( @@ -225,7 +224,7 @@ def validate_recovered_sig(request_id, msg_hash): sign_id = uint256_to_string(random.getrandbits(256)) sign_msg_hash = uint256_to_string(random.getrandbits(256)) quorumHash = self.nodes[0].quorum("selectquorum", 100, sign_id)["quorumHash"] - for mn in self.get_quorum_masternodes(quorumHash): # type: MasternodeInfo + for mn in self.get_quorum_masternodes(quorumHash): mn.get_node(self).quorum("sign", 100, sign_id, sign_msg_hash) validate_recovered_sig(sign_id, sign_msg_hash) # Unsubscribe from recovered signature messages diff --git a/test/functional/p2p_invalid_locator.py b/test/functional/p2p_invalid_locator.py index a586b48d4c00..2a521ec0d7a2 100755 --- a/test/functional/p2p_invalid_locator.py +++ b/test/functional/p2p_invalid_locator.py @@ -32,7 +32,7 @@ def run_test(self): within_max_peer = node.add_p2p_connection(P2PInterface()) msg.locator.vHave = [int(node.getblockhash(i - 1), 16) for i in range(block_count, block_count - (MAX_LOCATOR_SZ), -1)] within_max_peer.send_message(msg) - if type(msg) == msg_getheaders: + if type(msg) is msg_getheaders: within_max_peer.wait_for_header(node.getbestblockhash()) else: within_max_peer.wait_for_block(int(node.getbestblockhash(), 16)) diff --git a/test/functional/test_framework/crypto/siphash.py b/test/functional/test_framework/crypto/siphash.py index 884dbcab4694..bd13b2c948d8 100644 --- a/test/functional/test_framework/crypto/siphash.py +++ b/test/functional/test_framework/crypto/siphash.py @@ -31,7 +31,7 @@ def siphash_round(v0, v1, v2, v3): def siphash(k0, k1, data): - assert type(data) == bytes + assert type(data) is bytes v0 = 0x736f6d6570736575 ^ k0 v1 = 0x646f72616e646f6d ^ k1 v2 = 0x6c7967656e657261 ^ k0 @@ -61,5 +61,5 @@ def siphash(k0, k1, data): def siphash256(k0, k1, num): - assert type(num) == int + assert type(num) is int return siphash(k0, k1, num.to_bytes(32, 'little'))