Skip to content

Conversation

@circlecrystalin
Copy link

@circlecrystalin circlecrystalin commented Dec 19, 2025

Summary

This PR adds comprehensive enhancements to the crowdloan functionality, including a new contributors listing command and improved create/view capabilities with custom call support.

Changes

New Features

  • Contributors Command: Added btcli crowd contributors command to list all contributors for a specific crowdloan
    • Displays contributor addresses, contribution amounts, and identity information
    • Supports verbose mode for full addresses and precise amounts
    • JSON output support for programmatic access
    • Shows total contributions and contributor count

Enhancements

  • Create Command: Enhanced crowdloan creation with custom call support

    • Added validate_and_compose_custom_call function for validating and composing custom substrate calls
    • Improved error handling and validation for custom call parameters
    • Better JSON argument parsing and validation
  • View Command: Enhanced crowdloan view functionality

    • Improved display formatting and information presentation
    • Better handling of crowdloan details and status

Testing

  • Added comprehensive unit tests for contributors functionality (test_crowd_contributors.py)
  • Added unit tests for custom call validation (test_crowd_create_custom_call.py)
  • Added end-to-end tests for contributors (test_crowd_contributors.py)
  • Added end-to-end tests for identity display (test_crowd_identity_display.py)

Files Changed

  • bittensor_cli/src/commands/crowd/contributors.py (new file, 265 lines)
  • bittensor_cli/src/commands/crowd/create.py (187 lines added)
  • bittensor_cli/src/commands/crowd/view.py (533 lines added)
  • bittensor_cli/cli.py (158 lines added)
  • Test files: 4 new test files with comprehensive coverage

Testing

  • All unit tests pass
  • All e2e tests pass
  • Manual testing completed for contributors listing and custom call creation

Fix: #660

Contribution by Gittensor, learn more at https://gittensor.io/

@circlecrystalin
Copy link
Author

@ibraheem-abe I hope you had a good weekend, I hope my update will be helpful for you, could you please review my pr?

@ibraheem-abe ibraheem-abe self-requested a review December 23, 2025 04:16
@ibraheem-abe
Copy link
Contributor

Thank you for the contribution!
We will review this and get back to you soon

@circlecrystalin
Copy link
Author

@ibraheem-abe How is it going?

@ibraheem-abe
Copy link
Contributor

I will be looking and testing this today.

@ibraheem-abe
Copy link
Contributor

  • Removed --show-identities option from crowd list and crowd info; identities are always shown
  • Replaced individual query_identity() calls with query_all_identities() for batch fetching
  • Simplified contributors.py: removed redundant loops, simplified identity extraction
  • Made --show-contributors a boolean flag (no true/false value needed)
  • Fixed contributors alignment when listing contributors in a loan's details
  • Added subtensor method get_crowdloan_contributors() for fetching contributors
  • Added "Custom Call" option (option 3) to interactive crowd create prompt
  • Created prompt_custom_call_params() helper in crowd/utils.py for better parsing and UX with prompts for pallet, method, and JSON args
  • Added useful examples for custom extrinsics Shows examples before prompting
  • Simplified create.py by removing redundant validation code
  • Code Quality Improvements
  • Removed unnecessary hasattr() checks when accessing .value from query_map results
  • Consistent identity extraction pattern across all crowd commands
  • Better error handling with retry logic in custom call prompting

@ibraheem-abe ibraheem-abe requested a review from a team January 14, 2026 04:17
@ibraheem-abe ibraheem-abe added the enhancement New feature or request label Jan 14, 2026
@ibraheem-abe
Copy link
Contributor

Hi @circlecrystalin

Your PR while working at the surface, had alot of issues in terms of code placement and the way btcli does things.
You can refer to my individual commits to get an idea what were the improvements.

@ibraheem-abe ibraheem-abe force-pushed the feat/crownload-enhancements branch from 8aead8b to b1207a4 Compare January 14, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants