We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c552316 commit 504a9e4Copy full SHA for 504a9e4
1 file changed
minichain/block.py
@@ -1,6 +1,7 @@
1
import time
2
import hashlib
3
from typing import Optional # <-- Removed 'List' as requested
4
+from collections.abc import Sequence
5
6
from .transaction import Transaction
7
from .serialization import canonical_json_hash, canonical_json_bytes
@@ -9,8 +10,8 @@
9
10
def _sha256(data: str) -> str:
11
return hashlib.sha256(data.encode()).hexdigest()
12
-# <-- Updated 'List' to built-in 'list'
13
-def _calculate_merkle_root(transactions: list[Transaction]) -> Optional[str]:
+# <-- Updated to Sequence to accept the frozen tuple
14
+def _calculate_merkle_root(transactions: Sequence[Transaction]) -> Optional[str]:
15
if not transactions:
16
return None
17
0 commit comments