Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pcli): support new ibc query logic #3143

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented Oct 3, 2023

Previously pcli was only capable of looking up info on IBC clients, connections, and channels if the user provided a unique identifier for the resource in question. To facilitate IBC in practice, we want to enable querying for lists of these values, so the end user (or developer) can inspect the current options in a legible format.

Closes #2937.

@conorsch conorsch temporarily deployed to smoke-test October 3, 2023 22:27 — with GitHub Actions Inactive
@conorsch conorsch requested a review from avahowell October 5, 2023 00:11
@conorsch conorsch force-pushed the 2937-pcli-ibc-queries branch from 1821e7f to 0e5d28c Compare October 5, 2023 00:11
@conorsch conorsch temporarily deployed to smoke-test October 5, 2023 00:11 — with GitHub Actions Inactive
@conorsch
Copy link
Contributor Author

conorsch commented Oct 5, 2023

Requesting feedback from @avahowell. It might be useful to compare results between the current state of this PR and after applying this diff:

diff --git a/crates/bin/pcli/src/command/query/ibc_query.rs b/crates/bin/pcli/src/command/query/ibc_query.rs
index e821b93bf..6de19a816 100644
--- a/crates/bin/pcli/src/command/query/ibc_query.rs
+++ b/crates/bin/pcli/src/command/query/ibc_query.rs
@@ -83,12 +83,7 @@ impl IbcCmd {
                     .await?
                     .into_inner()
                     .client_states;
-                let clients_ids: Vec<String> =
-                    client_states.into_iter().map(|c| c.client_id).collect();
-                // TODO: Resolve formatting for these representations. The key_value lookup
-                // for IbcCmd::Client recasts as a TendermintClientState; the ibc ClientState
-                // is less informative. For now, just emitting the names.
-                let clients_json = serde_json::to_string_pretty(&clients_ids)?;
+                let clients_json = serde_json::to_string_pretty(&client_states)?;
                 println!("{}", clients_json.to_colored_json_auto()?);
             }
             IbcCmd::Connection { connection_id } => {

@conorsch conorsch temporarily deployed to smoke-test October 6, 2023 19:46 — with GitHub Actions Inactive
@conorsch conorsch force-pushed the 2937-pcli-ibc-queries branch from 37c7044 to 94f1106 Compare October 6, 2023 22:22
@conorsch conorsch force-pushed the 2937-pcli-ibc-queries branch from 94f1106 to 47da4a5 Compare October 6, 2023 23:45
@conorsch conorsch force-pushed the 2937-pcli-ibc-queries branch from 47da4a5 to a89b36d Compare October 6, 2023 23:50
@conorsch conorsch temporarily deployed to smoke-test October 6, 2023 23:50 — with GitHub Actions Inactive
@conorsch
Copy link
Contributor Author

conorsch commented Oct 6, 2023

Wasn't able to drag the channel (singular) logic over to the new format, so I left that as the old k/v lookup.

@conorsch conorsch marked this pull request as ready for review October 6, 2023 23:51
@conorsch conorsch force-pushed the 2937-pcli-ibc-queries branch from a89b36d to 5976aad Compare October 10, 2023 15:41
Previously pcli was only capable of looking up info on IBC clients,
connections, and channels if the user provided a unique identifier for
the resource in question. To facilitate IBC in practice, we want to
enable querying for lists of these values, so the end user (or
developer) can inspect the current options in a legible format.

All but the `channel` query have been updated. Submitting as-is
to ensure it lands in next testnet.

Closes #2937.

Co-authored-by: Ava Howell <ava@penumbralabs.xyz>
@conorsch conorsch force-pushed the 2937-pcli-ibc-queries branch from 5976aad to e99790d Compare October 10, 2023 15:47
@conorsch conorsch temporarily deployed to smoke-test October 10, 2023 15:47 — with GitHub Actions Inactive
@conorsch conorsch merged commit e85f527 into main Oct 10, 2023
8 checks passed
@conorsch conorsch deleted the 2937-pcli-ibc-queries branch October 10, 2023 16:10
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.

ibc: add ability to query all channels
1 participant