Skip to content

Commit 6f0352a

Browse files
committed
change to Assertion errors
1 parent 3c3e160 commit 6f0352a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

chia/_tests/plotting/test_prover.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def test_v2_prover_get_memo_raises_error(self) -> None:
2626
with pytest.raises(NotImplementedError, match="V2 plot format is not yet implemented"):
2727
prover.get_memo()
2828

29-
def test_v2_prover_get_compression_level_raises_error(self) -> None:
29+
def test_v2_prover_get_compression_level_raises_assertion_error(self) -> None:
3030
prover = V2Prover("/nonexistent/path/test.plot2")
31-
with pytest.raises(NotImplementedError, match="V2 plot format does not support compression level"):
31+
with pytest.raises(AssertionError, match="get_compression_level\\(\\) should never be called on V2 plots"):
3232
prover.get_compression_level()
3333

3434
def test_v2_prover_get_id_raises_error(self) -> None:

chia/farmer/farmer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def __init__(
143143
# Quality string to plot identifier and challenge_hash, for use with harvester.RequestSignatures
144144
self.quality_str_to_identifiers: dict[bytes32, tuple[str, bytes32, bytes32, bytes32]] = {}
145145

146-
# Track pending solver requests, keyed by quality string hex
146+
# Track pending solver requests, keyed by partial proof
147147
self.pending_solver_requests: dict[bytes, dict[str, Any]] = {}
148148

149149
# number of responses to each signage point

chia/plotting/prover.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_memo(self) -> bytes:
5656
raise NotImplementedError("V2 plot format is not yet implemented")
5757

5858
def get_compression_level(self) -> uint8:
59-
raise NotImplementedError("V2 plot format does not support compression level")
59+
raise AssertionError("get_compression_level() should never be called on V2 plots")
6060

6161
def get_version(self) -> PlotVersion:
6262
return PlotVersion.V2
@@ -78,8 +78,7 @@ def get_partial_proofs_for_challenge(self, challenge: bytes32) -> list[bytes]:
7878
raise NotImplementedError("V2 plot format is not yet implemented")
7979

8080
def get_full_proof(self, challenge: bytes32, index: int, parallel_read: bool = True) -> bytes:
81-
# TODO: todo_v2_plots Implement plot proof generation
82-
raise NotImplementedError("V2 plot format require solver to get full proof")
81+
raise AssertionError("V2 plot format require solver to get full proof")
8382

8483
@classmethod
8584
def from_bytes(cls, data: bytes) -> V2Prover:
@@ -121,7 +120,7 @@ def get_qualities_for_challenge(self, challenge: bytes32) -> list[bytes32]:
121120
return [bytes32(quality) for quality in self._disk_prover.get_qualities_for_challenge(challenge)]
122121

123122
def get_partial_proofs_for_challenge(self, challenge: bytes32) -> list[bytes]:
124-
raise NotImplementedError("V1 does not implement quality chains, only qualities")
123+
raise AssertionError("V1 does not implement quality chains, only qualities")
125124

126125
def get_full_proof(self, challenge: bytes32, index: int, parallel_read: bool = True) -> bytes:
127126
return bytes(self._disk_prover.get_full_proof(challenge, index, parallel_read))

0 commit comments

Comments
 (0)