From 38c3fd846bff163eb7c50bd77efcdcf8fcbc7f43 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Mon, 31 Jul 2023 12:09:33 -0600 Subject: [PATCH 1/2] test: python E721 updates --- test/functional/p2p_invalid_locator.py | 2 +- test/functional/test_framework/siphash.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/p2p_invalid_locator.py b/test/functional/p2p_invalid_locator.py index 626422370a8..32a23532a23 100755 --- a/test/functional/p2p_invalid_locator.py +++ b/test/functional/p2p_invalid_locator.py @@ -32,7 +32,7 @@ class InvalidLocatorTest(BitcoinTestFramework): 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/siphash.py b/test/functional/test_framework/siphash.py index 884dbcab469..bd13b2c948d 100644 --- a/test/functional/test_framework/siphash.py +++ b/test/functional/test_framework/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')) From bee2d57a655645dbfaf0242e85c5af034023a2fb Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Mon, 31 Jul 2023 12:10:06 -0600 Subject: [PATCH 2/2] script: update flake8 to 6.1.0 and touch up the spelling returned by lint-spelling.py --- ci/lint/04_install.sh | 2 +- src/test/fuzz/descriptor_parse.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index dbbd01e5079..8113500fb2e 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -35,7 +35,7 @@ python3 --version ${CI_RETRY_EXE} pip3 install \ codespell==2.2.5 \ - flake8==6.0.0 \ + flake8==6.1.0 \ lief==0.13.2 \ mypy==1.4.1 \ pyzmq==25.1.0 \ diff --git a/src/test/fuzz/descriptor_parse.cpp b/src/test/fuzz/descriptor_parse.cpp index b879b0d1414..8ed659323cd 100644 --- a/src/test/fuzz/descriptor_parse.cpp +++ b/src/test/fuzz/descriptor_parse.cpp @@ -85,7 +85,7 @@ public: 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 {};