Skip to content

Commit 50a2738

Browse files
future pparam inclusion
1 parent 7eb11a7 commit 50a2738

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

cardano_node_tests/tests/tests_conway/test_pparam_update.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ def test_pparam_update( # noqa: C901
278278
cluster, governance_data = cluster_lock_governance_plutus
279279
temp_template = common.get_test_id(cluster)
280280
cost_proposal_file = DATA_DIR / "cost_models_list_185_v2_v3.json"
281+
282+
# Check that no future parameters are scheduled at the start
283+
future_pparams_before = cluster.g_query.get_future_pparams()
284+
LOGGER.info(f"Initial future protocol parameters: {future_pparams_before}")
285+
assert not future_pparams_before, (
286+
"Expected no scheduled future protocol parameters before proposals"
287+
)
288+
281289
db_errors_final = []
282290
is_in_bootstrap = conway_common.is_in_bootstrap(cluster_obj=cluster)
283291

@@ -1214,6 +1222,47 @@ def _check_state(state: dict):
12141222
)
12151223
assert rat_action, "Action not found in ratified actions"
12161224

1225+
# Verify that future protocol parameters are now scheduled
1226+
future_pparams_after = cluster.g_query.get_future_pparams()
1227+
LOGGER.info(
1228+
f"Future protocol parameters after ratification: "
1229+
f"{list(future_pparams_after.keys())[:10]}"
1230+
)
1231+
1232+
assert future_pparams_after, "Expected future protocol parameters after ratification"
1233+
assert isinstance(future_pparams_after, dict), "Future pparams should be a dictionary"
1234+
1235+
future_pparams_after = cluster.g_query.get_future_pparams()
1236+
assert future_pparams_after, "Expected future protocol parameters after ratification"
1237+
1238+
mismatches = []
1239+
1240+
for proposal in fin_prop_rec.proposals:
1241+
param_name = proposal.name
1242+
expected_value = str(proposal.value)
1243+
1244+
# Some proposals (like costModels or empty name fields)
1245+
# might not directly map, so skip them
1246+
1247+
if not param_name:
1248+
LOGGER.debug(f"Skipping unnamed proposal (arg: {proposal.arg})")
1249+
continue
1250+
1251+
actual_value = str(future_pparams_after.get(param_name, ""))
1252+
1253+
if param_name not in future_pparams_after:
1254+
mismatches.append(f"Missing {param_name} in future params")
1255+
elif expected_value != actual_value:
1256+
mismatches.append(
1257+
f"Mismatch for {param_name}: expected {expected_value}, got {actual_value}"
1258+
)
1259+
else:
1260+
LOGGER.info(f"✓ {param_name} correctly scheduled: {actual_value}")
1261+
1262+
assert not mismatches, "Some future protocol parameters did not match:\n" + "\n".join(
1263+
mismatches
1264+
)
1265+
12171266
# Disapprove ratified action, the voting shouldn't have any effect
12181267
conway_common.cast_vote(
12191268
cluster_obj=cluster,

0 commit comments

Comments
 (0)