mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-11 01:28:17 +03:00
naming
This commit is contained in:
parent
7bbed0f44c
commit
14a8b36207
@ -101,13 +101,13 @@ def get_row_cmd(
|
||||
@create_row_data_option()
|
||||
@create_table_option()
|
||||
@create_rpc_port_option()
|
||||
def insert_row_cmd(
|
||||
row_data_string: str,
|
||||
def update_table(
|
||||
changelist: str,
|
||||
table_string: str,
|
||||
data_rpc_port: int,
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from chia.cmds.data_funcs import insert_row
|
||||
from chia.cmds.data_funcs import update
|
||||
|
||||
asyncio.run(insert_row(rpc_port=data_rpc_port, table_string=table_string, row_data_string=row_data_string))
|
||||
asyncio.run(update(rpc_port=data_rpc_port, table_string=table_string, changelist=changelist))
|
||||
|
@ -5,7 +5,7 @@ from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
|
||||
|
||||
class DataLayerRpcClient(RpcClient):
|
||||
async def create_table(self, table: bytes32, name: str) -> Dict:
|
||||
async def create_table(self, table: bytes32, name: str):
|
||||
response = await self.fetch("create_table", {"table": table.hex(), "name": name})
|
||||
return response
|
||||
|
||||
@ -13,9 +13,9 @@ class DataLayerRpcClient(RpcClient):
|
||||
response = await self.fetch("get_row", {"table": table.hex(), "row_hash": row_hash.hex()})
|
||||
return response
|
||||
|
||||
async def insert_row(self, table: bytes32, row_data: bytes) -> Dict:
|
||||
async def update(self, table: bytes32, changelist: bytes) -> Dict:
|
||||
response = await self.fetch(
|
||||
"update",
|
||||
{"table": table.hex(), "changelist": [{"action": "insert", "row_data": row_data.hex()}]},
|
||||
{"table": table.hex(), "changelist": changelist},
|
||||
)
|
||||
return response
|
||||
|
Loading…
Reference in New Issue
Block a user