From bd16a32cc45c8ce8a7d8799ac000eb8c20bec7f7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 21:25:06 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v6.0.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.21.2](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.21.2) - [github.com/PyCQA/autoflake: v2.2.1 → v2.3.1](https://github.com/PyCQA/autoflake/compare/v2.2.1...v2.3.1) - [github.com/PyCQA/isort: 5.12.0 → 7.0.0](https://github.com/PyCQA/isort/compare/5.12.0...7.0.0) - [github.com/DanielNoord/pydocstringformatter: v0.7.3 → v0.7.5](https://github.com/DanielNoord/pydocstringformatter/compare/v0.7.3...v0.7.5) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 23.9.1 → 25.12.0](https://github.com/psf/black-pre-commit-mirror/compare/23.9.1...25.12.0) - [github.com/PyCQA/flake8: 6.1.0 → 7.3.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.3.0) - [github.com/PyCQA/bandit: 1.7.5 → 1.9.2](https://github.com/PyCQA/bandit/compare/1.7.5...1.9.2) - [github.com/PyCQA/bandit: 1.7.5 → 1.9.2](https://github.com/PyCQA/bandit/compare/1.7.5...1.9.2) - [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.19.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.19.0) --- .pre-commit-config.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 86e8aa3..b42e831 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -32,13 +32,13 @@ repos: args: [--notice=COPYRIGHT] files: python - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.21.2 hooks: - id: pyupgrade args: [--py38-plus] # exclude: *fixtures - repo: https://github.com/PyCQA/autoflake - rev: v2.2.1 + rev: v2.3.1 hooks: - id: autoflake args: @@ -50,21 +50,21 @@ repos: - --remove-unused-variables - --remove-rhs-for-unused-variables - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort name: isort (black profile, in place fixes) args: ["--profile", "black", "--filter-files"] - repo: https://github.com/DanielNoord/pydocstringformatter - rev: v0.7.3 + rev: v0.7.5 hooks: - id: pydocstringformatter - repo: https://github.com/asottile/yesqa rev: v1.5.0 hooks: - id: yesqa - - repo: https://github.com/psf/black - rev: 23.9.1 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black name: black (in place fixes) @@ -75,12 +75,12 @@ repos: # https://pre-commit.com/#top_level-default_language_version # language_version: python3.11 - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.3.0 hooks: - id: flake8 additional_dependencies: [Flake8-pyproject] - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.9.2 hooks: - id: bandit name: bandit (checksig) @@ -88,7 +88,7 @@ repos: language: python types: [python] - repo: https://github.com/PyCQA/bandit - rev: 1.7.5 + rev: 1.9.2 hooks: - id: bandit name: bandit (tests) @@ -99,6 +99,6 @@ repos: language: python types: [python] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.19.0 hooks: - id: mypy From f4076c0a8151f56cb7bcaaa7550f2b437426054d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 21:26:35 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- btclib_node/chains.py | 8 ++------ btclib_node/chainstate/utxo_index.py | 6 +++--- tests/helpers.py | 4 ++-- tests/unit/chainstate/block_index.py | 4 ++-- tests/unit/p2p/messages/compact.py | 2 +- tests/unit/p2p/messages/data.py | 4 ++-- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/btclib_node/chains.py b/btclib_node/chains.py index 521635f..7bb4e4f 100644 --- a/btclib_node/chains.py +++ b/btclib_node/chains.py @@ -79,9 +79,7 @@ def __init__(self): "dnsseed.emzy.de", "seed.bitcoin.wiz.biz", ] - self.genesis = create_genesis( - 1231006505, 2083236893, 0x1D00FFFF, 1, 50 * 10**8 - ) + self.genesis = create_genesis(1231006505, 2083236893, 0x1D00FFFF, 1, 50 * 10**8) self.flags = [ (170061, "P2SH"), (363725, "DERSIG"), @@ -105,9 +103,7 @@ def __init__(self): "seed.testnet.bitcoin.sprovoost.nl", "testnet-seed.bluematt.me", ] - self.genesis = create_genesis( - 1296688602, 414098458, 0x1D00FFFF, 1, 50 * 10**8 - ) + self.genesis = create_genesis(1296688602, 414098458, 0x1D00FFFF, 1, 50 * 10**8) self.flags = [ (395, "P2SH"), (330776, "DERSIG"), diff --git a/btclib_node/chainstate/utxo_index.py b/btclib_node/chainstate/utxo_index.py index cbdef98..ab5b137 100644 --- a/btclib_node/chainstate/utxo_index.py +++ b/btclib_node/chainstate/utxo_index.py @@ -50,9 +50,9 @@ def add_block(self, block): for i, tx_out in enumerate(tx.vout): out_point = OutPoint(tx_id, i, check_validity=False) - self.updated_utxo_set[ - out_point.serialize(check_validity=False) - ] = tx_out + self.updated_utxo_set[out_point.serialize(check_validity=False)] = ( + tx_out + ) added.append(out_point) complete_transactions.append([prev_outputs, tx]) diff --git a/tests/helpers.py b/tests/helpers.py index 490a3cf..3950065 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -27,7 +27,7 @@ def generate_random_header_chain(length, start): previous_block_hash=previous_block_hash, merkle_root_=secrets.token_bytes(32), time=datetime.fromtimestamp(1231006505 + x + 1, timezone.utc), - bits=b"\x20\xFF\xFF\xFF", + bits=b"\x20\xff\xff\xff", nonce=1, check_validity=False, ) @@ -87,7 +87,7 @@ def generate_random_chain(length, start): [tx.serialize(True, False) for tx in transactions], hash256 )[::-1], time=datetime.fromtimestamp(1231006505 + x + 1, timezone.utc), - bits=b"\x20\xFF\xFF\xFF", + bits=b"\x20\xff\xff\xff", nonce=1, check_validity=False, ) diff --git a/tests/unit/chainstate/block_index.py b/tests/unit/chainstate/block_index.py index 37f63a9..6cc7ae3 100644 --- a/tests/unit/chainstate/block_index.py +++ b/tests/unit/chainstate/block_index.py @@ -15,7 +15,7 @@ def test_calculate_work(): "00" * 32, "00" * 32, datetime.fromtimestamp(1231006506, timezone.utc), - b"\x20\xFF\xFF\xFF", + b"\x20\xff\xff\xff", 1, ) brute_force_nonce(header) @@ -103,7 +103,7 @@ def test_block_info_serialization(): "00" * 32, "00" * 32, datetime.fromtimestamp(1231006506, timezone.utc), - b"\x20\xFF\xFF\xFF", + b"\x20\xff\xff\xff", 1, check_validity=False, ) diff --git a/tests/unit/p2p/messages/compact.py b/tests/unit/p2p/messages/compact.py index f8ea27a..5a8f832 100644 --- a/tests/unit/p2p/messages/compact.py +++ b/tests/unit/p2p/messages/compact.py @@ -44,7 +44,7 @@ def test_cmpctblock(): previous_block_hash="00" * 32, merkle_root_="00" * 32, time=datetime.fromtimestamp(1231006506, timezone.utc), - bits=b"\x20\xFF\xFF\xFF", + bits=b"\x20\xff\xff\xff", nonce=1, check_validity=False, ) diff --git a/tests/unit/p2p/messages/data.py b/tests/unit/p2p/messages/data.py index a44dee4..7511806 100644 --- a/tests/unit/p2p/messages/data.py +++ b/tests/unit/p2p/messages/data.py @@ -58,7 +58,7 @@ def test_block(): previous_block_hash="00" * 32, merkle_root_="00" * 32, time=datetime.fromtimestamp(1231006506, timezone.utc), - bits=b"\x20\xFF\xFF\xFF", + bits=b"\x20\xff\xff\xff", nonce=1, check_validity=False, ) @@ -85,7 +85,7 @@ def test_headers(): previous_block_hash=f"{x}{x}" * 32, merkle_root_="00" * 32, time=datetime.fromtimestamp(1231006506, timezone.utc), - bits=b"\x20\xFF\xFF\xFF", + bits=b"\x20\xff\xff\xff", nonce=1, check_validity=False, )