Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 11 additions & 39 deletions cardano_node_tests/tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
import allure
import pytest
from cardano_clusterlib import clusterlib
from packaging import version

from cardano_node_tests.tests import common
from cardano_node_tests.tests import issues
from cardano_node_tests.utils import clusterlib_utils
from cardano_node_tests.utils import helpers
from cardano_node_tests.utils.versions import VERSIONS

LOGGER = logging.getLogger(__name__)

Expand All @@ -32,54 +29,39 @@
PROTOCOL_PARAM_KEYS = frozenset(
(
"collateralPercentage",
"committeeMaxTermLength",
"committeeMinSize",
"costModels",
"decentralization",
"dRepActivity",
"dRepDeposit",
"dRepVotingThresholds",
"executionUnitPrices",
"extraPraosEntropy",
"govActionDeposit",
"govActionLifetime",
"maxBlockBodySize",
"maxBlockExecutionUnits",
"maxBlockHeaderSize",
"maxCollateralInputs",
"maxTxExecutionUnits",
"maxTxSize",
"maxValueSize",
"minFeeRefScriptCostPerByte",
"minPoolCost",
"minUTxOValue",
"monetaryExpansion",
"poolPledgeInfluence",
"poolRetireMaxEpoch",
"poolVotingThresholds",
"protocolVersion",
"stakeAddressDeposit",
"stakePoolDeposit",
"stakePoolTargetNum",
"treasuryCut",
"txFeeFixed",
"txFeePerByte",
"utxoCostPerWord",
)
)
PROTOCOL_PARAM_KEYS_1_35_2 = frozenset(("utxoCostPerByte",))

PROTOCOL_PARAM_KEYS_CONWAY = frozenset(
(
"govActionLifetime",
"govActionDeposit",
"committeeMaxTermLength",
"dRepDeposit",
"poolVotingThresholds",
"dRepVotingThresholds",
"committeeMinSize",
"minFeeRefScriptCostPerByte",
"dRepActivity",
"utxoCostPerByte",
)
)

PROTOCOL_PARAM_KEYS_MISSING_8_6_0 = frozenset(("utxoCostPerWord",))

PROTOCOL_PARAM_KEYS_MISSING_8_12_0 = frozenset(
("minUTxOValue", "decentralization", "extraPraosEntropy")
)


@common.SKIPIF_WRONG_ERA
class TestProtocol:
Expand Down Expand Up @@ -130,18 +112,8 @@ def test_protocol_params(self, cluster: clusterlib.ClusterLib):
common.get_test_id(cluster)
protocol_params = cluster.g_query.get_protocol_params()

# The sets were updated for Conway, so there's nothing to add or remove at the moment.
union_with: tp.FrozenSet[str] = frozenset()
if clusterlib_utils.cli_has(
"legacy governance create-update-proposal --utxo-cost-per-byte"
):
union_with = union_with.union(PROTOCOL_PARAM_KEYS_1_35_2)
if VERSIONS.cluster_era >= VERSIONS.CONWAY:
union_with = union_with.union(PROTOCOL_PARAM_KEYS_CONWAY)

rem: tp.FrozenSet[str] = frozenset()
if clusterlib_utils.cli_has("conway"):
rem = rem.union(PROTOCOL_PARAM_KEYS_MISSING_8_6_0)
if VERSIONS.node >= version.parse("8.12.0"):
rem = rem.union(PROTOCOL_PARAM_KEYS_MISSING_8_12_0)

assert set(protocol_params) == PROTOCOL_PARAM_KEYS.union(union_with).difference(rem)