From 7429d8245fe4e15b97ad2dd472977537f530b6c4 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 20 Nov 2024 13:55:05 +0100 Subject: [PATCH] feat(governance): add error for testnet default governance Raise a ValueError when attempting to get default governance on testnets. This ensures that the function does not proceed with unsupported operations on testnet environments. --- cardano_node_tests/utils/governance_setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cardano_node_tests/utils/governance_setup.py b/cardano_node_tests/utils/governance_setup.py index 49d44ff8f..e2725d206 100644 --- a/cardano_node_tests/utils/governance_setup.py +++ b/cardano_node_tests/utils/governance_setup.py @@ -250,6 +250,10 @@ def get_default_governance( cluster_manager: cluster_management.ClusterManager, cluster_obj: clusterlib.ClusterLib, ) -> governance_utils.GovernanceRecords: + if cluster_nodes.get_cluster_type().type == cluster_nodes.ClusterType.TESTNET: + err = "Default governance is not available on testnets" + raise ValueError(err) + cluster_env = cluster_nodes.get_cluster_env() gov_data_dir = cluster_env.state_dir / GOV_DATA_DIR gov_data_store = gov_data_dir / GOV_DATA_STORE