|
7 | 7 | import shutil
|
8 | 8 | import sqlite3
|
9 | 9 | from collections import defaultdict
|
10 |
| -from collections.abc import AsyncIterator, Awaitable, Collection, Mapping |
| 10 | +from collections.abc import AsyncIterator, Awaitable, Collection |
11 | 11 | from contextlib import asynccontextmanager
|
12 | 12 | from dataclasses import dataclass, replace
|
13 | 13 | from hashlib import sha256
|
@@ -226,28 +226,6 @@ async def insert_into_data_store_from_file(
|
226 | 226 | # Don't store these blob objects into cache, since their data structures are not calculated yet.
|
227 | 227 | await self.insert_root_from_merkle_blob(merkle_blob, store_id, Status.COMMITTED, update_cache=False)
|
228 | 228 |
|
229 |
| - async def process_merkle_blob_queries( |
230 |
| - self, |
231 |
| - store_id: bytes32, |
232 |
| - queries: Mapping[bytes32, list[TreeIndex]], |
233 |
| - ) -> tuple[dict[bytes32, tuple[bytes32, bytes32]], dict[bytes32, tuple[KeyId, ValueId]]]: |
234 |
| - internal_nodes: dict[bytes32, tuple[bytes32, bytes32]] = {} |
235 |
| - terminal_nodes: dict[bytes32, tuple[KeyId, ValueId]] = {} |
236 |
| - |
237 |
| - for root_hash_blob, indexes in queries.items(): |
238 |
| - merkle_blob = await self.get_merkle_blob(store_id=store_id, root_hash=root_hash_blob, read_only=True) |
239 |
| - for index in indexes: |
240 |
| - nodes = merkle_blob.get_nodes_with_indexes(index=index) |
241 |
| - # TODO: consider implementing all or in part in rust for potential speedup |
242 |
| - index_to_hash = {index: node.hash for index, node in nodes} |
243 |
| - for _, node in nodes: |
244 |
| - if isinstance(node, chia_rs.datalayer.LeafNode): |
245 |
| - terminal_nodes[node.hash] = (node.key, node.value) |
246 |
| - elif isinstance(node, chia_rs.datalayer.InternalNode): |
247 |
| - internal_nodes[node.hash] = (index_to_hash[node.left], index_to_hash[node.right]) |
248 |
| - |
249 |
| - return internal_nodes, terminal_nodes |
250 |
| - |
251 | 229 | async def build_merkle_blob_queries_for_missing_hashes(
|
252 | 230 | self,
|
253 | 231 | missing_hashes: Collection[bytes32],
|
|
0 commit comments