Skip to content

Commit 504a9e4

Browse files
committed
chore(block): update type hint for _calculate_merkle_root to Sequence
1 parent c552316 commit 504a9e4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

minichain/block.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import time
22
import hashlib
33
from typing import Optional # <-- Removed 'List' as requested
4+
from collections.abc import Sequence
45

56
from .transaction import Transaction
67
from .serialization import canonical_json_hash, canonical_json_bytes
@@ -9,8 +10,8 @@
910
def _sha256(data: str) -> str:
1011
return hashlib.sha256(data.encode()).hexdigest()
1112

12-
# <-- Updated 'List' to built-in 'list'
13-
def _calculate_merkle_root(transactions: list[Transaction]) -> Optional[str]:
13+
# <-- Updated to Sequence to accept the frozen tuple
14+
def _calculate_merkle_root(transactions: Sequence[Transaction]) -> Optional[str]:
1415
if not transactions:
1516
return None
1617

0 commit comments

Comments
 (0)