Skip to content

Commit dcb3381

Browse files
committed
rename calculate_plot_strength() -> calculate_required_plot_strength()
1 parent 7ebeeda commit dcb3381

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

chia/_tests/core/custom_types/test_proof_of_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from chia._tests.util.misc import Marks, datacases
1313
from chia.consensus.default_constants import DEFAULT_CONSTANTS
1414
from chia.types.blockchain_format.proof_of_space import (
15-
calculate_plot_strength,
1615
calculate_prefix_bits,
16+
calculate_required_plot_strength,
1717
check_plot_size,
1818
make_pos,
1919
passes_plot_filter,
@@ -220,7 +220,7 @@ def test_verify_and_get_quality_string_v2(caplog: pytest.LogCaptureFixture, case
220220
],
221221
)
222222
def test_calculate_plot_strength(height: uint32, strength: uint8) -> None:
223-
assert calculate_plot_strength(DEFAULT_CONSTANTS, height) == strength
223+
assert calculate_required_plot_strength(DEFAULT_CONSTANTS, height) == strength
224224

225225

226226
@pytest.mark.parametrize(

chia/harvester/harvester_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
from chia.server.api_protocol import ApiMetadata
2727
from chia.server.ws_connection import WSChiaConnection
2828
from chia.types.blockchain_format.proof_of_space import (
29-
calculate_plot_strength,
3029
calculate_pos_challenge,
3130
calculate_prefix_bits,
31+
calculate_required_plot_strength,
3232
generate_plot_public_key,
3333
make_pos,
3434
passes_plot_filter,
@@ -153,7 +153,7 @@ async def new_signage_point_harvester(
153153
start = time.monotonic()
154154
assert len(new_challenge.challenge_hash) == 32
155155

156-
plot_strength = calculate_plot_strength(self.harvester.constants, new_challenge.last_tx_height)
156+
plot_strength = calculate_required_plot_strength(self.harvester.constants, new_challenge.last_tx_height)
157157

158158
loop = asyncio.get_running_loop()
159159

chia/simulator/block_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
from chia.types.blockchain_format.coin import Coin
9090
from chia.types.blockchain_format.program import DEFAULT_FLAGS, INFINITE_COST, Program, _run, run_with_cost
9191
from chia.types.blockchain_format.proof_of_space import (
92-
calculate_plot_strength,
9392
calculate_pos_challenge,
9493
calculate_prefix_bits,
94+
calculate_required_plot_strength,
9595
generate_plot_public_key,
9696
generate_taproot_sk,
9797
make_pos,
@@ -1502,7 +1502,7 @@ def get_pospaces_for_challenge(
15021502
rng = random.Random()
15031503
rng.seed(seed)
15041504

1505-
plot_strength = calculate_plot_strength(constants, height)
1505+
plot_strength = calculate_required_plot_strength(constants, height)
15061506
for plot_info in self.plot_manager.plots.values():
15071507
plot_id: bytes32 = plot_info.prover.get_id()
15081508
if force_plot_id is not None and plot_id != force_plot_id:

chia/types/blockchain_format/proof_of_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def verify_and_get_quality_string(
142142
# === V2 plots ===
143143
assert plot_size.size_v2 is not None
144144

145-
plot_strength = calculate_plot_strength(constants, height)
145+
plot_strength = calculate_required_plot_strength(constants, height)
146146
return validate_proof_v2(plot_id, plot_size.size_v2, plot_strength, pos.challenge, bytes(pos.proof))
147147

148148

@@ -181,7 +181,7 @@ def calculate_prefix_bits(constants: ConsensusConstants, height: uint32, plot_si
181181
return max(0, prefix_bits)
182182

183183

184-
def calculate_plot_strength(constants: ConsensusConstants, height: uint32) -> uint8:
184+
def calculate_required_plot_strength(constants: ConsensusConstants, height: uint32) -> uint8:
185185
if height < constants.PLOT_DIFFICULTY_4_HEIGHT:
186186
return constants.PLOT_DIFFICULTY_INITIAL
187187
if height < constants.PLOT_DIFFICULTY_5_HEIGHT:

0 commit comments

Comments
 (0)