Skip to content

Commit

Permalink
fix last datalayer stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jack60612 committed Jun 18, 2024
1 parent 6ba10c1 commit c3288a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 8 additions & 12 deletions chia/cmds/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
import logging
from pathlib import Path
from typing import Any, Callable, Coroutine, Dict, List, Optional, TypeVar, Union
from typing import Any, Callable, Coroutine, Dict, List, Optional, Sequence, TypeVar, Union

import click

Expand Down Expand Up @@ -449,7 +449,7 @@ def get_root_history(
@create_rpc_port_option()
@options.create_fingerprint()
def add_missing_files(
ids: List[str],
ids: Sequence[bytes32],
overwrite: bool,
directory: Optional[str],
data_rpc_port: int,
Expand All @@ -460,7 +460,7 @@ def add_missing_files(
run(
add_missing_files_cmd(
rpc_port=data_rpc_port,
ids=ids if ids else None,
ids=list(ids) if ids else None,
overwrite=overwrite,
foldername=None if directory is None else Path(directory),
fingerprint=fingerprint,
Expand Down Expand Up @@ -616,25 +616,23 @@ def check_plugins(
"clear_pending_roots",
help="Clear pending roots that will not be published, associated data may not be recoverable",
)
@click.option("-i", "--id", "id_str", help="Store ID", type=str, required=True)
@create_data_store_id_option()
@click.confirmation_option(
prompt="Associated data may not be recoverable.\nAre you sure you want to remove the pending roots?",
)
@create_rpc_port_option()
@options.create_fingerprint()
def clear_pending_roots(
id_str: str,
id: bytes32,
data_rpc_port: int,
fingerprint: Optional[int],
) -> None:
from chia.cmds.data_funcs import clear_pending_roots

store_id = bytes32.from_hexstr(id_str)

run(
clear_pending_roots(
rpc_port=data_rpc_port,
store_id=store_id,
store_id=id,
fingerprint=fingerprint,
)
)
Expand Down Expand Up @@ -669,16 +667,14 @@ def wallet_log_in(
@create_key_option(multiple=True)
@options.create_fingerprint()
def get_proof(
id: str,
id: bytes32,
key_strings: List[str],
data_rpc_port: int,
fingerprint: Optional[int],
) -> None:
from chia.cmds.data_funcs import get_proof_cmd

store_id = bytes32.from_hexstr(id)

run(get_proof_cmd(rpc_port=data_rpc_port, store_id=store_id, fingerprint=fingerprint, key_strings=key_strings))
run(get_proof_cmd(rpc_port=data_rpc_port, store_id=id, fingerprint=fingerprint, key_strings=key_strings))


@data_cmd.command(
Expand Down
4 changes: 2 additions & 2 deletions chia/cmds/data_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@ async def get_root_history_cmd(

async def add_missing_files_cmd(
rpc_port: Optional[int],
ids: Optional[List[str]],
ids: Optional[List[bytes32]],
overwrite: bool,
foldername: Optional[Path],
fingerprint: Optional[int],
) -> None:
async with get_client(rpc_port=rpc_port, fingerprint=fingerprint) as (client, _):
res = await client.add_missing_files(
store_ids=(None if ids is None else [bytes32.from_hexstr(id) for id in ids]),
store_ids=ids,
overwrite=overwrite,
foldername=foldername,
)
Expand Down

0 comments on commit c3288a7

Please sign in to comment.