-
Notifications
You must be signed in to change notification settings - Fork 358
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
Introduce LightBlock support for MockContext #390
Conversation
Codecov Report
@@ Coverage Diff @@
## master informalsystems/hermes#390 +/- ##
=========================================
+ Coverage 13.6% 34.6% +20.9%
=========================================
Files 69 155 +86
Lines 3752 10456 +6704
Branches 1374 3852 +2478
=========================================
+ Hits 513 3621 +3108
- Misses 2618 6213 +3595
- Partials 621 622 +1
Continue to review full report at Codecov.
|
Signed-off-by: Thane Thomson <connect@thanethomson.com>
modules/src/ics18_relayer/utils.rs
Outdated
.with_client(&client_on_a_for_b, client_on_a_for_b_height); | ||
let mut ctx_b = MockContext::new( | ||
ChainId::new("mockgaia", 1).unwrap(), | ||
HostType::Mock, |
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.
HostType::Mock, | |
HostType::SynteticTendermint, |
It would be good to create different types of contexts in the test. I think there are a few places where the code still needs to be updated, e.g. with_client_parametrized()
or store_client_state()
.
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.
Modified context ctx_b
to rely on a HostType::SynteticTendermint
chain and updated the relevant parts.
Note that some verification functions (like this one) are incomplete, but will add more checks in there as we go along and write new tests.
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.
Very cool! The first time that we have different chains and client types
Applied Anca's comments Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
* Bringing changes from the older PR informalsystems#289, first pass. * Second pass * Third pass done, finished bringing old changes. * Updated changelog * Removed useless test conditional compilation. * Clippy exceptions to disable dead code warning * Removing dep on the dev branch * Update tendermint-testgen dependency Signed-off-by: Thane Thomson <connect@thanethomson.com> * Prep context to store multiple types of clients. Deleted mock error. * Moved module mock_client into mock * Generalized MockClientRecord * with_client_parametrized done * Added basic implementation for TM::check_header_and_update_state. * Apply suggestions from code review Applied Anca's comments Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com> Co-authored-by: Thane Thomson <connect@thanethomson.com> Co-authored-by: Anca Zamfir <zamfiranca@gmail.com> Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
Overview
Closes informalsystems/ibc-rs#100
Description
This PR introduces two important changes:
1. Module
mock_context.rs
was expandedThis module was broken down into two separate modules:
context.rs
with an implementation ofMockContext
https://github.com/informalsystems/ibc-rs/blob/110a3d81dc811820a73879fe43ce8a384f435c4a/modules/src/mock/context.rs#L31
and
host.rs
with various host chain-specific types, e.g.,HostBlock
https://github.com/informalsystems/ibc-rs/blob/b9b4667699a2b7f3b2e95d1421389fea800b93c0/modules/src/mock/host.rs#L30-L33
Note that two types of blocks are now possible: mocks or synthetically generated Tendermint blocks (based on testgen).
2. The ibc crate now exports a
mocks
featurehttps://github.com/informalsystems/ibc-rs/blob/b9b4667699a2b7f3b2e95d1421389fea800b93c0/modules/Cargo.toml#L17-L20
This feature grants the relayer access to mock structures, so the relayer can build an in-process mock chain based on
MockContext
.For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.