Skip to content

Commit

Permalink
Update proof_of_work.py
Browse files Browse the repository at this point in the history
  • Loading branch information
divyaSree-S0 authored Oct 10, 2024
1 parent 1e3b382 commit 38904a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blockchain/proof_of_work.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def proof_of_work(difficulty: int) -> int:
"""
Simulates a Proof of Work mining process.
The miner must find a nonce such that the hash of the nonce starts
The miner must find a nonce such that the hash of the nonce starts

Check failure on line 9 in blockchain/proof_of_work.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (W291)

blockchain/proof_of_work.py:9:71: W291 Trailing whitespace
with a specific number of leading zeros (difficulty).
Args:
Expand All @@ -20,7 +20,7 @@ def proof_of_work(difficulty: int) -> int:
>>> isinstance(result, int)
True
"""
prefix = "0" * difficulty
prefix = '0' * difficulty
nonce = 0
start = time.time() # Timing starts

Check failure on line 25 in blockchain/proof_of_work.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F841)

blockchain/proof_of_work.py:25:5: F841 Local variable `start` is assigned to but never used

Expand Down

0 comments on commit 38904a3

Please sign in to comment.