Skip to content

Commit

Permalink
feat(governance): add error for testnet default governance
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mkoura committed Nov 20, 2024
1 parent 4bcbd07 commit 7429d82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cardano_node_tests/utils/governance_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7429d82

Please sign in to comment.