Skip to content

Commit 6ee3d9e

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

blockchain/proof_of_work.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import hashlib
22
import time
33

4+
45
def proof_of_work(difficulty: int) -> int:
56
"""
67
Simulates a Proof of Work mining process.
78
8-
The miner must find a nonce such that the hash of the nonce starts
9+
The miner must find a nonce such that the hash of the nonce starts
910
with a specific number of leading zeros (difficulty).
1011
1112
Args:
@@ -19,7 +20,7 @@ def proof_of_work(difficulty: int) -> int:
1920
>>> isinstance(result, int)
2021
True
2122
"""
22-
prefix = '0' * difficulty
23+
prefix = "0" * difficulty
2324
nonce = 0
2425
start = time.time() # Timing starts
2526

0 commit comments

Comments
 (0)