Skip to content

Commit 0554c4c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d58b5ef commit 0554c4c

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

btclib_node/chains.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ def __init__(self):
7979
"dnsseed.emzy.de",
8080
"seed.bitcoin.wiz.biz",
8181
]
82-
self.genesis = create_genesis(
83-
1231006505, 2083236893, 0x1D00FFFF, 1, 50 * 10**8
84-
)
82+
self.genesis = create_genesis(1231006505, 2083236893, 0x1D00FFFF, 1, 50 * 10**8)
8583
self.flags = [
8684
(170061, "P2SH"),
8785
(363725, "DERSIG"),
@@ -105,9 +103,7 @@ def __init__(self):
105103
"seed.testnet.bitcoin.sprovoost.nl",
106104
"testnet-seed.bluematt.me",
107105
]
108-
self.genesis = create_genesis(
109-
1296688602, 414098458, 0x1D00FFFF, 1, 50 * 10**8
110-
)
106+
self.genesis = create_genesis(1296688602, 414098458, 0x1D00FFFF, 1, 50 * 10**8)
111107
self.flags = [
112108
(395, "P2SH"),
113109
(330776, "DERSIG"),

btclib_node/chainstate/utxo_index.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def add_block(self, block):
5050

5151
for i, tx_out in enumerate(tx.vout):
5252
out_point = OutPoint(tx_id, i, check_validity=False)
53-
self.updated_utxo_set[
54-
out_point.serialize(check_validity=False)
55-
] = tx_out
53+
self.updated_utxo_set[out_point.serialize(check_validity=False)] = (
54+
tx_out
55+
)
5656
added.append(out_point)
5757

5858
complete_transactions.append([prev_outputs, tx])

tests/helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def generate_random_header_chain(length, start):
2727
previous_block_hash=previous_block_hash,
2828
merkle_root_=secrets.token_bytes(32),
2929
time=datetime.fromtimestamp(1231006505 + x + 1, timezone.utc),
30-
bits=b"\x20\xFF\xFF\xFF",
30+
bits=b"\x20\xff\xff\xff",
3131
nonce=1,
3232
check_validity=False,
3333
)
@@ -87,7 +87,7 @@ def generate_random_chain(length, start):
8787
[tx.serialize(True, False) for tx in transactions], hash256
8888
)[::-1],
8989
time=datetime.fromtimestamp(1231006505 + x + 1, timezone.utc),
90-
bits=b"\x20\xFF\xFF\xFF",
90+
bits=b"\x20\xff\xff\xff",
9191
nonce=1,
9292
check_validity=False,
9393
)

tests/unit/chainstate/block_index.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_calculate_work():
1515
"00" * 32,
1616
"00" * 32,
1717
datetime.fromtimestamp(1231006506, timezone.utc),
18-
b"\x20\xFF\xFF\xFF",
18+
b"\x20\xff\xff\xff",
1919
1,
2020
)
2121
brute_force_nonce(header)
@@ -103,7 +103,7 @@ def test_block_info_serialization():
103103
"00" * 32,
104104
"00" * 32,
105105
datetime.fromtimestamp(1231006506, timezone.utc),
106-
b"\x20\xFF\xFF\xFF",
106+
b"\x20\xff\xff\xff",
107107
1,
108108
check_validity=False,
109109
)

tests/unit/p2p/messages/compact.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_cmpctblock():
4444
previous_block_hash="00" * 32,
4545
merkle_root_="00" * 32,
4646
time=datetime.fromtimestamp(1231006506, timezone.utc),
47-
bits=b"\x20\xFF\xFF\xFF",
47+
bits=b"\x20\xff\xff\xff",
4848
nonce=1,
4949
check_validity=False,
5050
)

tests/unit/p2p/messages/data.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_block():
5858
previous_block_hash="00" * 32,
5959
merkle_root_="00" * 32,
6060
time=datetime.fromtimestamp(1231006506, timezone.utc),
61-
bits=b"\x20\xFF\xFF\xFF",
61+
bits=b"\x20\xff\xff\xff",
6262
nonce=1,
6363
check_validity=False,
6464
)
@@ -85,7 +85,7 @@ def test_headers():
8585
previous_block_hash=f"{x}{x}" * 32,
8686
merkle_root_="00" * 32,
8787
time=datetime.fromtimestamp(1231006506, timezone.utc),
88-
bits=b"\x20\xFF\xFF\xFF",
88+
bits=b"\x20\xff\xff\xff",
8989
nonce=1,
9090
check_validity=False,
9191
)

0 commit comments

Comments
 (0)