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

Added CLI to query for all connections #565

Merged
merged 5 commits into from
Jan 28, 2021
Merged

Added CLI to query for all connections #565

merged 5 commits into from
Jan 28, 2021

Conversation

adizere
Copy link
Member

@adizere adizere commented Jan 27, 2021

Closes: #553

Example output:

$ rrly -c config.toml query connections ibc-1

{"status":"success","result":[["connection-0","connection-1"]]}

For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

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

Looks great! Just one small comment, will leave it up to you.

@@ -44,3 +44,15 @@ impl From<ConnectionIds> for RawClientConnections {
}
}
}

impl FromIterator<ConnectionId> for ConnectionIds {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Haven't noticed this file before. Why is it called raw.rs and part of the ics02_client? Its content relates to connections. It would be nice to move this to ics03_connection.

Copy link
Member Author

@adizere adizere Jan 28, 2021

Choose a reason for hiding this comment

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

This file was added during one of the first queries, query client connections I think in #169.

The RawClientConnections connections and ConnectionIds are the main types in this file. It's not really clear to me at this point where it would be best to place these types.

I'll move the file to ICS03, which I agree is a better place than ICS02. But still this file contains a raw/proto type, which is the weirdest part that should be solved; I propose we refactor this and move stuff around as necessary in https://github.com/informalsystems/ibc-rs/issues/425.

Copy link
Collaborator

Choose a reason for hiding this comment

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

RawClientConnections is defined locally, not part of any protofbuf. And it is not what the name suggests, it's just a vector of String -s. I'm not sure we need it at all to be honest. If we keep it, ics03 is the best place. I will take care of cleaning it in the next PR.

@ancazamfir
Copy link
Collaborator

One more thing, could you optimize imports on the changed files?

@codecov-io
Copy link

codecov-io commented Jan 28, 2021

Codecov Report

Merging #565 (e94b3dd) into master (b1b37f5) will increase coverage by 31.8%.
The diff coverage is 67.8%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    informalsystems/hermes#565      +/-   ##
=========================================
+ Coverage    13.6%   45.5%   +31.8%     
=========================================
  Files          69     142      +73     
  Lines        3752    9355    +5603     
  Branches     1374       0    -1374     
=========================================
+ Hits          513    4261    +3748     
- Misses       2618    5094    +2476     
+ Partials      621       0     -621     
Impacted Files Coverage Δ
...application/ics20_fungible_token_transfer/error.rs 0.0% <0.0%> (ø)
...pplication/ics20_fungible_token_transfer/events.rs 0.0% <ø> (ø)
...ion/ics20_fungible_token_transfer/msgs/transfer.rs 0.0% <0.0%> (ø)
modules/src/events.rs 0.0% <0.0%> (ø)
modules/src/ics02_client/error.rs 100.0% <ø> (ø)
modules/src/ics03_connection/error.rs 100.0% <ø> (+66.6%) ⬆️
modules/src/ics03_connection/msgs/conn_open_try.rs 86.7% <ø> (ø)
modules/src/ics03_connection/raw.rs 0.0% <ø> (ø)
modules/src/ics03_connection/version.rs 97.6% <ø> (ø)
modules/src/ics04_channel/channel.rs 77.2% <ø> (+62.1%) ⬆️
... and 268 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 033af38...e94b3dd. Read the comment docs.

@adizere adizere mentioned this pull request Jan 28, 2021
5 tasks
@ancazamfir ancazamfir merged commit d57e89c into master Jan 28, 2021
@ancazamfir ancazamfir deleted the adi/553_conns branch January 28, 2021 11:54
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Added query for informalsystems#553 and upd changelog.

* Moved the 'raw' ConnectionIds file from ICS02 to ICS03

* Optimized imports à la intellij

* Cargo fmt

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
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.

Query all connections CLI
3 participants