We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c44d753 commit 00f590bCopy full SHA for 00f590b
1 file changed
blockchain/simple_blockchain.py
@@ -11,7 +11,6 @@
11
12
import hashlib
13
from time import time
14
-from typing import List, Tuple
15
16
17
class Block:
@@ -57,7 +56,7 @@ def compute_hash(self, nonce: int) -> str:
57
56
)
58
return hashlib.sha256(block_string.encode()).hexdigest()
59
60
- def mine_block(self, difficulty: int) -> Tuple[int, str]:
+ def mine_block(self, difficulty: int) -> tuple[int, str]:
61
"""
62
Simple Proof-of-Work mining algorithm.
63
@@ -92,7 +91,7 @@ class Blockchain:
92
91
93
def __init__(self, difficulty: int = 2) -> None:
94
self.difficulty = difficulty
95
- self.chain: List[Block] = [self.create_genesis_block()]
+ self.chain: list[Block] = [self.create_genesis_block()]
96
97
def create_genesis_block(self) -> Block:
98
0 commit comments