Skip to content

Commit

Permalink
Merge pull request #2730 from IntersectMBO/use_pparam_query
Browse files Browse the repository at this point in the history
refactor: update current protocol params query method
  • Loading branch information
mkoura authored Nov 4, 2024
2 parents 265c7fb + b2a97aa commit ffae598
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions cardano_node_tests/tests/tests_conway/conway_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def is_in_bootstrap(
cluster_obj: clusterlib.ClusterLib,
) -> bool:
"""Check if the cluster is in bootstrap period."""
pv = cluster_obj.g_conway_governance.query.gov_state()["currentPParams"]["protocolVersion"][
"major"
]
pv = cluster_obj.g_query.get_protocol_params()["protocolVersion"]["major"]
return bool(pv == 9)


Expand Down
2 changes: 1 addition & 1 deletion cardano_node_tests/tests/tests_conway/test_committee.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def test_add_rm_committee_members( # noqa: C901
# undelegated stake is treated as Abstain. If undelegated stake was treated as No, it
# would not be possible to approve any action.
delegated_stake = governance_utils.get_delegated_stake(cluster_obj=cluster)
cur_pparams = cluster.g_conway_governance.query.gov_state()["currentPParams"]
cur_pparams = cluster.g_query.get_protocol_params()
drep_constitution_threshold = cur_pparams["dRepVotingThresholds"]["committeeNormal"]
spo_constitution_threshold = cur_pparams["poolVotingThresholds"]["committeeNormal"]
is_drep_total_below_threshold = (
Expand Down
6 changes: 3 additions & 3 deletions cardano_node_tests/tests/tests_conway/test_pparam_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def test_pparam_update( # noqa: C901
# undelegated stake is treated as Abstain. If undelegated stake was treated as Yes, then
# missing votes would approve the action.
delegated_stake = governance_utils.get_delegated_stake(cluster_obj=cluster)
cur_pparams = cluster.g_conway_governance.query.gov_state()["currentPParams"]
cur_pparams = cluster.g_query.get_protocol_params()
drep_constitution_threshold = cur_pparams["dRepVotingThresholds"]["ppGovGroup"]
spo_constitution_threshold = cur_pparams["poolVotingThresholds"]["ppSecurityGroup"]
is_drep_total_below_threshold = (
Expand Down Expand Up @@ -590,7 +590,7 @@ def test_pparam_update( # noqa: C901
]

# Hand-picked parameters and values that can stay changed even for other tests
cur_pparams = cluster.g_conway_governance.query.gov_state()["currentPParams"]
cur_pparams = cluster.g_query.get_protocol_params()
fin_update_proposals = [
# From network group
clusterlib_utils.UpdateProposal(
Expand Down Expand Up @@ -1353,7 +1353,7 @@ def test_pparam_keys(
_url = helpers.get_vcs_link()
[r.start(url=_url) for r in (reqc.cip075, reqc.cip076, reqc.cip077, reqc.cip078)]

cur_pparam = cluster.g_conway_governance.query.gov_state()["currentPParams"]
cur_pparam = cluster.g_query.get_protocol_params()
cur_pparam_keys = set(cur_pparam.keys())
known_pparam_keys = set().union(
NETWORK_GROUP_PPARAMS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ def _update_cost_model() -> None:
conway_common.save_gov_state(
gov_state=enact_gov_state, name_template=f"{temp_template}_enact_{enact_epoch}"
)
pparams = (
enact_gov_state.get("curPParams") or enact_gov_state.get("currentPParams") or {}
)
pparams = enact_gov_state.get("currentPParams") or {}
assert len(pparams["costModels"]["PlutusV2"]) == 185

# Check that Plutus script fails as expected in PV9
Expand Down

0 comments on commit ffae598

Please sign in to comment.