-
Notifications
You must be signed in to change notification settings - Fork 357
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
Add mocking capabilities for ibc querying #1620
Conversation
5d207d3
to
1d574aa
Compare
1d574aa
to
c19953d
Compare
@hashedone could you review this PR to ensure it serves your needs for multitest? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't exactly like the fact the implementation implements only half of the queried cases (querying "own" ports - I agree it is probably the most useful one, but with just a bit more work, the whole query domain could be covered).
It doesn't have much to do with multitest - it would have its query, and there would be a "mock" relayer passing messages, and opening channels, so it would simulate the chain behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@hashedone @webmaster128 thanks for your reviews. If there aren't any more reviewers, could we please merge this? |
let ibc = IbcQuerier::new("myport", &[chan1]); | ||
|
||
// query channels matching "myport" (should be none) | ||
let query = &&IbcQuery::PortId {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why clippy is not complaining about this double reference 🤷♂️ But it seems to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like clippy hasn't implemented lints for useless borrows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Anyways, fixed in #1624
Published as part of 1.2.2 today |
This PR adds an IBC querier implementation to the
MockQuerier
. The functionality is gated by thestargate
feature.