Skip to content

Commit f3cf774

Browse files
committed
test(conway): add checks for future pparams query
1 parent 3e1c66d commit f3cf774

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cardano_node_tests/tests/tests_conway/test_pparam_update.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,8 @@ def _check_proposed_pparams(
11451145
)
11461146
fin_approve_epoch = cluster.g_query.get_epoch()
11471147

1148+
assert not cluster.g_query.get_future_pparams(), "Future pparams should be empty"
1149+
11481150
# db-sync check
11491151
[r.start(url=_url) for r in (reqc.cip080, reqc.cip081, reqc.cip082, reqc.cip083)]
11501152
try:
@@ -1194,7 +1196,7 @@ def _check_proposed_pparams(
11941196
)
11951197

11961198
def _check_state(state: dict):
1197-
pparams = state.get("curPParams") or state.get("currentPParams") or {}
1199+
pparams = state.get("curPParams") or state.get("currentPParams") or state or {}
11981200
clusterlib_utils.check_updated_params(
11991201
update_proposals=fin_update_proposals, protocol_params=pparams
12001202
)
@@ -1228,6 +1230,7 @@ def _check_state(state: dict):
12281230

12291231
next_rat_state = rat_gov_state["nextRatifyState"]
12301232
_check_state(next_rat_state["nextEnactState"])
1233+
_check_state(cluster.g_query.get_future_pparams())
12311234
reqc.cip038_04.start(url=helpers.get_vcs_link())
12321235
assert not next_rat_state["ratificationDelayed"], "Ratification is delayed unexpectedly"
12331236
reqc.cip038_04.success()
@@ -1282,6 +1285,8 @@ def _check_state(state: dict):
12821285
if is_spo_total_below_threshold:
12831286
reqc.cip064_04.success()
12841287

1288+
assert not cluster.g_query.get_future_pparams(), "Future pparams should be empty"
1289+
12851290
# db-sync check
12861291
try:
12871292
reqc.db024.start(url=helpers.get_vcs_link())

cardano_node_tests/utils/clusterlib_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,10 @@ def _get_param(key: str) -> tp.Any:
642642

643643
def check_updated_params(*, update_proposals: list[UpdateProposal], protocol_params: dict) -> None:
644644
"""Compare update proposals with actual protocol parameters."""
645+
if not protocol_params:
646+
msg = "Protocol parameters dictionary is empty!"
647+
raise ValueError(msg)
648+
645649
failures = []
646650
for u in update_proposals:
647651
if u.check_func:

0 commit comments

Comments
 (0)