Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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)
Expand All @@ -75,20 +75,20 @@ 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)
exclude: ".*test.*"
language: python
types: [python]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.9.2
hooks:
- id: bandit
name: bandit (tests)
Expand All @@ -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
8 changes: 2 additions & 6 deletions btclib_node/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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"),
Expand Down
6 changes: 3 additions & 3 deletions btclib_node/chainstate/utxo_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/chainstate/block_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/p2p/messages/compact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/p2p/messages/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand Down