Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions chia/_tests/util/build_network_protocol_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def visit_farmer_protocol(visitor: Callable[[Any, str], None]) -> None:
visitor(request_signed_values, "request_signed_values")
visitor(farming_info, "farming_info")
visitor(signed_values, "signed_values")
visitor(partial_proof, "partial_proof")


def visit_solver_protocol(visitor: Callable[[Any, str], None]) -> None:
visitor(solver_info, "solver_info")
visitor(solver_response, "solver_response")


def visit_full_node(visitor: Callable[[Any, str], None]) -> None:
Expand Down Expand Up @@ -170,6 +176,7 @@ def visit_all_messages(visitor: Callable[[Any, str], None]) -> None:
visit_pool_protocol(visitor)
visit_timelord_protocol(visitor)
visit_shared_protocol(visitor)
visit_solver_protocol(visitor)


def get_protocol_bytes() -> bytes:
Expand Down
27 changes: 27 additions & 0 deletions chia/_tests/util/network_protocol_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
harvester_protocol,
introducer_protocol,
pool_protocol,
solver_protocol,
timelord_protocol,
wallet_protocol,
)
Expand Down Expand Up @@ -150,6 +151,27 @@
),
)

partial_proof = harvester_protocol.PartialProofsData(
bytes32.fromhex("42743566108589c11bb3811b347900b6351fd3e25bad6c956c0bf1c05a4d93fb"),
bytes32.fromhex("8a346e8dc02e9b44c0571caa74fd99f163d4c5d7deaedac87125528721493f7a"),
"plot-filename",
[b"partial-proof1", b"partial-proof2"],
uint8(4),
uint8(32),
uint64(100000),
G1Element.from_bytes(
bytes.fromhex(
"a04c6b5ac7dfb935f6feecfdd72348ccf1d4be4fe7e26acf271ea3b7d308da61e0a308f7a62495328a81f5147b66634c"
),
),
bytes32.fromhex("91240fbacdf93b44c0571caa74fd99f163d4c5d7deaedac87125528721493f7a"),
G1Element.from_bytes(
bytes.fromhex(
"a04c6b5ac7dfb935f6feecfdd72348ccf1d4be4fe7e26acf271ea3b7d308da61e0a308f7a62495328a81f5147b66634c"
),
),
)


# FULL NODE PROTOCOL.
new_peak = full_node_protocol.NewPeak(
Expand Down Expand Up @@ -1082,3 +1104,8 @@
uint32(386395693),
uint8(224),
)

# SOLVER PROTOCOL
solver_info = solver_protocol.SolverInfo(uint64(2), b"partial-proof")

solver_response = solver_protocol.SolverResponse(b"partial-proof", b"full-proof")
Binary file modified chia/_tests/util/protocol_messages_bytes-v1.0
Binary file not shown.
20 changes: 20 additions & 0 deletions chia/_tests/util/protocol_messages_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@
"foliage_transaction_block_signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
}

partial_proof_json: dict[str, Any] = {
"challenge_hash": "0x42743566108589c11bb3811b347900b6351fd3e25bad6c956c0bf1c05a4d93fb",
"sp_hash": "0x8a346e8dc02e9b44c0571caa74fd99f163d4c5d7deaedac87125528721493f7a",
"plot_identifier": "plot-filename",
"partial_proofs": ["0x7061727469616c2d70726f6f6631", "0x7061727469616c2d70726f6f6632"],
"signage_point_index": 4,
"plot_size": 32,
"difficulty": 100000,
"pool_public_key": "0xa04c6b5ac7dfb935f6feecfdd72348ccf1d4be4fe7e26acf271ea3b7d308da61e0a308f7a62495328a81f5147b66634c",
"pool_contract_puzzle_hash": "0x91240fbacdf93b44c0571caa74fd99f163d4c5d7deaedac87125528721493f7a",
"plot_public_key": "0xa04c6b5ac7dfb935f6feecfdd72348ccf1d4be4fe7e26acf271ea3b7d308da61e0a308f7a62495328a81f5147b66634c",
}

new_peak_json: dict[str, Any] = {
"header_hash": "0x8a346e8dc02e9b44c0571caa74fd99f163d4c5d7deae9f8ddb00528721493f7a",
"height": 2653549198,
Expand Down Expand Up @@ -2701,3 +2714,10 @@
error_without_data_json: dict[str, Any] = {"code": 1, "message": "Unknown", "data": None}

error_with_data_json: dict[str, Any] = {"code": 1, "message": "Unknown", "data": "0x65787472612064617461"}

solver_info_json: dict[str, Any] = {"plot_difficulty": 2, "partial_proof": "0x7061727469616c2d70726f6f66"}

solver_response_json: dict[str, Any] = {
"partial_proof": "0x7061727469616c2d70726f6f66",
"proof": "0x66756c6c2d70726f6f66",
}
Loading
Loading