Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Apr 26, 2024
1 parent 0aa9e71 commit a0ab73c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions chia/data_layer/data_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ async def batch_update(
else:
return None

async def _get_publishable_root_hash(self, tree_id: bytes32) -> bytes32:
pending_root: Optional[Root] = await self.data_store.get_pending_root(store_id=tree_id)
async def _get_publishable_root_hash(self, store_id: bytes32) -> bytes32:
pending_root: Optional[Root] = await self.data_store.get_pending_root(store_id=store_id)
if pending_root is None:
raise Exception("Latest root is already confirmed.")
if pending_root.status == Status.PENDING_BATCH:
Expand Down Expand Up @@ -298,7 +298,7 @@ async def multistore_batch_update(
update_dictionary: Dict[bytes32, bytes32] = {}
for store_id in store_ids:
await self._update_confirmation_status(store_id=store_id)
root_hash = await self._get_publishable_root_hash(tree_id=store_id)
root_hash = await self._get_publishable_root_hash(store_id=store_id)
update_dictionary[store_id] = root_hash
transaction_records = await self.wallet_rpc.dl_update_multiple(update_dictionary=update_dictionary, fee=fee)
return transaction_records
Expand Down Expand Up @@ -369,7 +369,7 @@ async def publish_update(
fee: uint64,
) -> TransactionRecord:
await self._update_confirmation_status(store_id=store_id)
root_hash = await self._get_publishable_root_hash(tree_id=store_id)
root_hash = await self._get_publishable_root_hash(store_id=store_id)
transaction_record = await self.wallet_rpc.dl_update_root(
launcher_id=store_id,
new_root=root_hash,
Expand Down
4 changes: 2 additions & 2 deletions chia/data_layer/data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ async def get_all_pending_batches_roots(self) -> List[Root]:
{"status": Status.PENDING_BATCH.value},
)
roots = [Root.from_row(row=row) async for row in cursor]
tree_ids = [root.store_id for root in roots]
if len(set(tree_ids)) != len(tree_ids):
store_ids = [root.store_id for root in roots]
if len(set(store_ids)) != len(store_ids):
raise Exception("Internal error: multiple pending batches for a store")
return roots

Expand Down

0 comments on commit a0ab73c

Please sign in to comment.