mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-21 08:31:52 +03:00
lint
This commit is contained in:
parent
d219619301
commit
c9df6d21d1
@ -1,8 +1,11 @@
|
||||
import json
|
||||
import logging
|
||||
from typing import Coroutine
|
||||
|
||||
import click
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO: this is more general and should be part of refactoring the overall CLI code duplication
|
||||
def run(coro: Coroutine):
|
||||
@ -11,9 +14,10 @@ def run(coro: Coroutine):
|
||||
response = asyncio.run(coro)
|
||||
|
||||
success = response is not None and response.get("success", False)
|
||||
logger.info(f"data layer cli call response:{success}")
|
||||
# todo make sure all cli methods follow this pattern, uncomment
|
||||
# if not success:
|
||||
# raise click.ClickException(message=f"query unsuccessful, response: {response}")
|
||||
# raise click.ClickException(message=f"query unsuccessful, response: {response}")
|
||||
|
||||
|
||||
@click.group("data", short_help="Manage your data")
|
||||
|
@ -84,7 +84,7 @@ class DataLayer:
|
||||
# todo create singelton with wavaluellet and get id
|
||||
store_id = await self.wallet.create_data_store()
|
||||
res = await self.data_store.create_tree(store_id)
|
||||
if res == False:
|
||||
if res is False:
|
||||
self.log.error("Failed to create tree")
|
||||
return store_id
|
||||
|
||||
@ -118,7 +118,7 @@ class DataLayer:
|
||||
# todo create singelton with wallet and get id
|
||||
id = "0102030405060708091011121314151617181920212223242526272829303132"
|
||||
res = await self.data_store.create_tree(id)
|
||||
if res == False:
|
||||
if res is False:
|
||||
self.log.error("Failed to create tree")
|
||||
return id
|
||||
|
||||
|
@ -5,7 +5,6 @@ from chia.data_layer.data_layer import DataLayer
|
||||
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
|
||||
# todo input assertions for all rpc's
|
||||
|
||||
|
@ -17,8 +17,6 @@ from chia.data_layer.data_layer import DataLayer
|
||||
from chia.data_layer.data_store import DataStore
|
||||
from chia.rpc.data_layer_rpc_api import DataLayerRpcApi
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
from chia.util.db_wrapper import DBWrapper
|
||||
from chia.util.default_root import DEFAULT_ROOT_PATH
|
||||
from tests.block_tools import create_block_tools_async
|
||||
@ -106,7 +104,7 @@ class ChiaRoot:
|
||||
def chia_root_fixture(tmp_path: pathlib.Path) -> ChiaRoot:
|
||||
root = ChiaRoot(path=tmp_path.joinpath("chia_root"))
|
||||
root.run(args=["init"])
|
||||
root.run(args=["configure", "--set-log-level", "DEBUG"])
|
||||
root.run(args=["configure", "--set-log-level", "INFO"])
|
||||
|
||||
return root
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
from typing import List, Dict
|
||||
import pytest
|
||||
|
||||
# flake8: noqa: F401
|
||||
import aiosqlite
|
||||
from chia.consensus.default_constants import DEFAULT_CONSTANTS
|
||||
from chia.data_layer.data_layer import DataLayer
|
||||
|
Loading…
Reference in New Issue
Block a user