Skip to content

Conversation

@KPrasch
Copy link
Member

@KPrasch KPrasch commented Nov 5, 2025

Type of PR:
Feature

Required reviews:
1

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new command-line script to retrieve signing cohort conditions from the SigningCoordinator contract. The script provides a CLI interface using Click to query cohort conditions by domain, cohort ID, and chain ID.

  • Implements a new get-cohort-conditions CLI command using Click and Ape frameworks
  • Validates domain support and retrieves cohort conditions from the SigningCoordinator contract
  • Outputs the retrieved conditions in formatted JSON

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if domain not in TESTNET_PROVIDERS:
raise click.ClickException(f"Unsupported domain: {domain}. Supported domains are: {', '.join(TESTNET_PROVIDERS)}")

print(f"Setting conditions for cohort {cohort_id} on {domain}:{network} with chain ID {chain_id}")
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message says 'Setting conditions' but this script only retrieves/gets conditions. The message should read 'Getting conditions for cohort...' to accurately reflect the script's purpose.

Suggested change
print(f"Setting conditions for cohort {cohort_id} on {domain}:{network} with chain ID {chain_id}")
print(f"Getting conditions for cohort {cohort_id} on {domain}:{network} with chain ID {chain_id}")

Copilot uses AI. Check for mistakes.
result = signing_coordinator.getSigningCohortConditions(cohort_id, chain_id)

print("Cohort Conditions:")
print(json.dumps(json.loads(result), indent=4))
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling json.loads() on result assumes it's a JSON string, but result is likely already a structured object from the contract call. This will fail if result is not a string. Either use json.dumps(result, indent=4, default=str) directly, or verify the actual return type of getSigningCohortConditions().

Suggested change
print(json.dumps(json.loads(result), indent=4))
print(json.dumps(result, indent=4, default=str))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant