Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardteach42 committed Dec 14, 2022
1 parent cd2e073 commit fce0276
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tests/clvm/test_curry_and_treehash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from chinilla.types.blockchain_format.program import Program
from chinilla.wallet.puzzles import (
p2_delegated_puzzle_or_hidden_puzzle # import (puzzle_for_pk, puzzle_hash_for_pk, MOD),
p2_delegated_puzzle_or_hidden_puzzle, # import (puzzle_for_pk, puzzle_hash_for_pk, MOD),
)
from chinilla.wallet.util.curry_and_treehash import calculate_hash_of_quoted_mod_hash, curry_and_treehash

Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ async def wallet_and_node():


@pytest_asyncio.fixture(scope="function")
async def one_node_one_block() -> AsyncIterator[Tuple[Union[FullNodeAPI, FullNodeSimulator], ChinillaServer, BlockTools]]:
async def one_node_one_block() -> AsyncIterator[
Tuple[Union[FullNodeAPI, FullNodeSimulator], ChinillaServer, BlockTools]
]:
async_gen = setup_simulators_and_wallets(1, 0, {})
nodes, _, bt = await async_gen.__anext__()
full_node_1 = nodes[0]
Expand Down
8 changes: 2 additions & 6 deletions tests/connection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ async def disconnect_all(server: ChinillaServer) -> None:


async def disconnect_all_and_reconnect(
server: ChinillaServer,
reconnect_to: ChinillaServer,
self_hostname: str
server: ChinillaServer, reconnect_to: ChinillaServer, self_hostname: str
) -> bool:
await disconnect_all(server)
return await server.start_client(PeerInfo(self_hostname, uint16(reconnect_to._port)), None)
Expand Down Expand Up @@ -78,9 +76,7 @@ async def add_dummy_connection(


async def connect_and_get_peer(
server_1: ChinillaServer,
server_2: ChinillaServer,
self_hostname: str
server_1: ChinillaServer, server_2: ChinillaServer, self_hostname: str
) -> WSChinillaConnection:
"""
Connect server_2 to server_1, and get return the connection in server_1.
Expand Down
10 changes: 3 additions & 7 deletions tests/core/data_layer/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
@pytest.fixture(name="chinilla_daemon", scope="function")
def chinilla_daemon_fixture(chinilla_root: ChinillaRoot) -> Iterator[None]:
with closing_chinilla_root_popen(
chinilla_root=chinilla_root,
args=[sys.executable, "-m", "chinilla.daemon.server"]
chinilla_root=chinilla_root, args=[sys.executable, "-m", "chinilla.daemon.server"]
):
# TODO: this is not pretty as a hard coded time
# let it settle
Expand All @@ -44,13 +43,10 @@ def chinilla_daemon_fixture(chinilla_root: ChinillaRoot) -> Iterator[None]:

@pytest.fixture(name="chinilla_data", scope="function")
def chinilla_data_fixture(
chinilla_root: ChinillaRoot,
chinilla_daemon: None,
scripts_path: pathlib.Path
chinilla_root: ChinillaRoot, chinilla_daemon: None, scripts_path: pathlib.Path
) -> Iterator[None]:
with closing_chinilla_root_popen(
chinilla_root=chinilla_root,
args=[os.fspath(scripts_path.joinpath("chinilla_data_layer"))]
chinilla_root=chinilla_root, args=[os.fspath(scripts_path.joinpath("chinilla_data_layer"))]
):
# TODO: this is not pretty as a hard coded time
# let it settle
Expand Down
3 changes: 1 addition & 2 deletions tests/core/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ async def test_daemon_terminates(signal_number: signal.Signals, chinilla_root: C
save_config(root_path=chinilla_root.path, filename="config.yaml", config_data=config)

with closing_chinilla_root_popen(
chinilla_root=chinilla_root,
args=[sys.executable, "-m", "chinilla.daemon.server"]
chinilla_root=chinilla_root, args=[sys.executable, "-m", "chinilla.daemon.server"]
) as process:
client = await wait_for_daemon_connection(root_path=chinilla_root.path, config=config)

Expand Down
4 changes: 3 additions & 1 deletion tests/generator/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"decompress_coin_spend_entry_with_prefix.clvm", package_or_requirement="chinilla.wallet.puzzles"
)
DECOMPRESS_BLOCK = load_clvm("block_program_zero.clvm", package_or_requirement="chinilla.wallet.puzzles")
TEST_MULTIPLE = load_clvm("test_multiple_generator_input_arguments.clvm", package_or_requirement="chinilla.wallet.puzzles")
TEST_MULTIPLE = load_clvm(
"test_multiple_generator_input_arguments.clvm", package_or_requirement="chinilla.wallet.puzzles"
)

Nil = Program.from_bytes(b"\x80")

Expand Down
15 changes: 13 additions & 2 deletions tests/util/network_protocol_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
from chinilla.types.spend_bundle import SpendBundle
from chinilla.types.blockchain_format.program import Program, SerializedProgram
from chinilla.types.blockchain_format.sub_epoch_summary import SubEpochSummary
from chinilla.types.weight_proof import WeightProof, SubEpochData, SubEpochChallengeSegment, SubSlotData, RecentChainData
from chinilla.types.weight_proof import (
WeightProof,
SubEpochData,
SubEpochChallengeSegment,
SubSlotData,
RecentChainData,
)
from chinilla.types.blockchain_format.vdf import VDFInfo, VDFProof
from chinilla.types.blockchain_format.classgroup import ClassgroupElement
from blspy import G1Element, G2Element
Expand All @@ -25,7 +31,12 @@
from chinilla.types.end_of_slot_bundle import EndOfSubSlotBundle
from chinilla.types.peer_info import TimestampedPeerInfo
from chinilla.types.blockchain_format.reward_chain_block import RewardChainBlock
from chinilla.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, FoliageBlockData, TransactionsInfo
from chinilla.types.blockchain_format.foliage import (
Foliage,
FoliageTransactionBlock,
FoliageBlockData,
TransactionsInfo,
)

from chinilla.protocols import (
farmer_protocol,
Expand Down
4 changes: 1 addition & 3 deletions tests/wallet/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ async def test_wallet_send_to_three_peers(
async def test_wallet_make_transaction_hop(
self,
two_wallet_nodes_five_freeze: Tuple[
List[FullNodeSimulator],
List[Tuple[WalletNode, ChinillaServer]],
BlockTools
List[FullNodeSimulator], List[Tuple[WalletNode, ChinillaServer]], BlockTools
],
trusted: bool,
self_hostname: str,
Expand Down

0 comments on commit fce0276

Please sign in to comment.