Skip to content

Commit 87d42b7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2ce385a commit 87d42b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

blockchain/proof_of_work.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from datetime import datetime, timezone
66
import hashlib
77

8+
89
class Block:
910
def __init__(self, index: int, previous_hash: str, data: str, timestamp: str):
1011
self.index = index
@@ -26,18 +27,23 @@ def get_block(self) -> str:
2627
"""
2728
Returns a formatted string of the block
2829
"""
29-
return f"Block {self.index}:\nHash: {self.calculate_hash()}\nData: {self.data}\n"
30+
return (
31+
f"Block {self.index}:\nHash: {self.calculate_hash()}\nData: {self.data}\n"
32+
)
33+
3034

3135
def create_genesis_block() -> Block:
3236
"""
3337
Creates the first block in the blockchain
3438
"""
3539
return Block(0, "0", "Genesis Block", datetime.now(timezone.utc).isoformat())
3640

41+
3742
def get_latest_block() -> Block:
3843
"""
3944
Returns the latest block in the blockchain
4045
"""
4146
pass # Implement logic to return the latest block
4247

48+
4349
# Further implementation here...

0 commit comments

Comments
 (0)