Skip to content

Conversation

@moliholy
Copy link
Collaborator

@moliholy moliholy commented Oct 8, 2025

Closes #665.

This PR:

  • Allows pop call chain to specify not only extrinsics, but also constants and storage.
  • Polishes how documentation is displayed. No more double or leading spaces.
  • Adds filtering options to some selections.
  • Makes the option to query functions, storage and constants the first one in the list, and renames it to "Other" instead of "All". This is done from the assumption that users will want to interact more, and several times in a row, with the new functionality.
  • Marks as "yes" the option by default to perform more calls, since now this option is way more useful.

Screenshots

Screenshot 2025-10-08 at 18 49 48
Screenshot 2025-10-08 at 18 46 54
90d908f0-28d7-4eec-9371-6bbaab18160d

@moliholy moliholy self-assigned this Oct 8, 2025
@moliholy moliholy force-pushed the feat/chain-call-read branch from 33b7470 to f93566d Compare October 8, 2025 17:18
@moliholy moliholy force-pushed the feat/chain-call-read branch from f93566d to 74b7377 Compare October 8, 2025 17:21
@moliholy moliholy marked this pull request as ready for review October 8, 2025 17:22
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 78.86109% with 245 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.79%. Comparing base (1a4d270) to head (3640a25).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/pop-cli/src/commands/call/chain.rs 54.14% 110 Missing and 34 partials ⚠️
crates/pop-chains/src/call/metadata/mod.rs 88.33% 53 Missing and 36 partials ⚠️
crates/pop-cli/src/common/chain.rs 77.77% 6 Missing and 2 partials ⚠️
crates/pop-chains/src/call/mod.rs 60.00% 1 Missing and 1 partial ⚠️
crates/pop-chains/src/call/metadata/params.rs 87.50% 1 Missing ⚠️
crates/pop-cli/src/commands/call/contract.rs 91.66% 0 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##             main     #664      +/-   ##
==========================================
+ Coverage   76.66%   76.79%   +0.12%     
==========================================
  Files         108      108              
  Lines       23370    24280     +910     
  Branches    23370    24280     +910     
==========================================
+ Hits        17917    18646     +729     
- Misses       3582     3702     +120     
- Partials     1871     1932      +61     
Files with missing lines Coverage Δ
crates/pop-chains/src/call/metadata/action.rs 96.05% <100.00%> (-0.06%) ⬇️
crates/pop-chains/src/errors.rs 100.00% <ø> (ø)
crates/pop-chains/src/lib.rs 0.00% <ø> (ø)
crates/pop-cli/src/commands/up/rollup.rs 69.45% <100.00%> (+0.16%) ⬆️
crates/pop-common/src/lib.rs 83.82% <ø> (ø)
crates/pop-contracts/src/utils/metadata.rs 89.81% <100.00%> (+0.31%) ⬆️
crates/pop-chains/src/call/metadata/params.rs 91.42% <87.50%> (+0.33%) ⬆️
crates/pop-cli/src/commands/call/contract.rs 63.74% <91.66%> (ø)
crates/pop-chains/src/call/mod.rs 63.06% <60.00%> (+0.06%) ⬆️
crates/pop-cli/src/common/chain.rs 84.48% <77.77%> (+4.77%) ⬆️
... and 2 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@moliholy moliholy requested a review from Daanvdplas October 9, 2025 00:27
@moliholy moliholy force-pushed the feat/chain-call-read branch from 1192c67 to 292c287 Compare October 9, 2025 09:04
@moliholy moliholy force-pushed the feat/chain-call-read branch from da1d282 to 2ed23ea Compare October 13, 2025 14:59
@moliholy moliholy force-pushed the feat/chain-call-read branch from f26c9a5 to 0d1e0a7 Compare October 13, 2025 17:18
@moliholy moliholy force-pushed the feat/chain-call-read branch from 0d1e0a7 to 5155ad8 Compare October 13, 2025 17:27
Copy link
Collaborator

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

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

I tried out the issues we talked about yesterday and did some extra testing and everything’s running smoothly! Super cool feature, great work!

Copy link
Member

@al3mart al3mart left a comment

Choose a reason for hiding this comment

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

Still half way through the review, but as I will need to complete this tomorrow I'm leaving a nit for now, but this is pretty cool! :)

@moliholy moliholy force-pushed the feat/chain-call-read branch from 925a142 to 9f3a0dc Compare October 15, 2025 09:06
Copy link
Member

@al3mart al3mart left a comment

Choose a reason for hiding this comment

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

On testing the feature and doing some queries I've noted the following:

  • When I querying a map without providing any key as a parameter I was able to obtain all the values for the map, but the keys were not listed. More concretely the map I was reading was CoreDescriptors.

⚙ pop call chain --pallet CoretimeAssignmentProvider --function CoreDescriptors --url wss://paseo.dotters.network/

Image

I think that if I'm querying all entries of a map without passing any concrete key it would be useful getting the keys as well.

  • I tried querying, without passing any key as parameter, a storage item that expects a tuple as a key: CoreSchedules. This time I got the following parsing error:
⚙  pop call chain --pallet CoretimeAssignmentProvider --function CoreSchedules --url wss://paseo.dotters.network/
│  
■  Failed to query storage: Error parsing metadata for parameter Failed to fetch storage value: Error encoding storage address: Not enough remaining bytes to decode the storage address/key

I was surprised by the different behaviors even if in both cases the parameters were marked as required.

The feat is pretty awesome! I feel the cases as above might be more edge or complex cases that could potentially need some iterations. But in general I feel that this PR is good to go. I'd be happy to introduce fixes as iterations of this feat as we move ahead and identify things, if at all.
Would hold from approval until @moliholy has a chance to see this.

@moliholy
Copy link
Collaborator Author

@al3maal thanks for the feedback! I'll take a look today to see if I can address all that. If it's too cumbersome we can iterate in the future.

@al3mart
Copy link
Member

al3mart commented Oct 16, 2025

I think iterating might make the most sense, @moliholy . But I'll wait until you have had some time to have a look at it :)

@moliholy
Copy link
Collaborator Author

@al3mart @AlexD10S the problem pointed out is indeed a corner case. I think we're good to merge for now and we can address this in the future.

Copy link
Member

@al3mart al3mart left a comment

Choose a reason for hiding this comment

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

I'm happy with iterating over the edge cases outside of this PR. Let's go!

@moliholy
Copy link
Collaborator Author

@moliholy moliholy force-pushed the feat/chain-call-read branch from c2a67ba to 4de50c6 Compare October 16, 2025 12:55
Copy link
Member

@al3mart al3mart left a comment

Choose a reason for hiding this comment

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

🚀

@moliholy moliholy merged commit 22943bb into main Oct 16, 2025
19 checks passed
@moliholy moliholy deleted the feat/chain-call-read branch October 16, 2025 14:39
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.

Allow pop call chain to query constants and storage

4 participants