Skip to content

Commit 7429d82

Browse files
committed
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.
1 parent 4bcbd07 commit 7429d82

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cardano_node_tests/utils/governance_setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ def get_default_governance(
250250
cluster_manager: cluster_management.ClusterManager,
251251
cluster_obj: clusterlib.ClusterLib,
252252
) -> governance_utils.GovernanceRecords:
253+
if cluster_nodes.get_cluster_type().type == cluster_nodes.ClusterType.TESTNET:
254+
err = "Default governance is not available on testnets"
255+
raise ValueError(err)
256+
253257
cluster_env = cluster_nodes.get_cluster_env()
254258
gov_data_dir = cluster_env.state_dir / GOV_DATA_DIR
255259
gov_data_store = gov_data_dir / GOV_DATA_STORE

0 commit comments

Comments
 (0)