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

Last riff on Mock Context cleanup #310

Merged
merged 16 commits into from
Oct 20, 2020
Merged

Last riff on Mock Context cleanup #310

merged 16 commits into from
Oct 20, 2020

Conversation

adizere
Copy link
Member

@adizere adizere commented Oct 14, 2020

Closes: #297
Also closes cosmos/ibc-rs#111


For contributor use:

  • Unit tests written
  • Added test to CI if applicable
  • Updated CHANGELOG_PENDING.md
  • 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

@adizere adizere self-assigned this Oct 14, 2020
@codecov-io
Copy link

codecov-io commented Oct 16, 2020

Codecov Report

Merging #310 into master will increase coverage by 24.7%.
The diff coverage is 64.3%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    informalsystems/hermes#310      +/-   ##
=========================================
+ Coverage    13.6%   38.4%   +24.7%     
=========================================
  Files          69     118      +49     
  Lines        3752    7626    +3874     
  Branches     1374    2715    +1341     
=========================================
+ Hits          513    2930    +2417     
- Misses       2618    4523    +1905     
+ Partials      621     173     -448     
Impacted Files Coverage Δ
modules/src/events.rs 0.0% <0.0%> (ø)
modules/src/ics02_client/events.rs 0.0% <ø> (ø)
modules/src/ics02_client/raw.rs 0.0% <0.0%> (ø)
modules/src/ics03_connection/error.rs 15.0% <0.0%> (-18.4%) ⬇️
modules/src/ics04_channel/error.rs 75.0% <ø> (+50.0%) ⬆️
modules/src/ics04_channel/packet.rs 0.0% <0.0%> (ø)
modules/src/ics07_tendermint/client_def.rs 0.0% <0.0%> (ø)
modules/src/ics07_tendermint/error.rs 75.0% <ø> (+75.0%) ⬆️
modules/src/ics18_relayer/error.rs 0.0% <0.0%> (ø)
modules/src/ics26_routing/error.rs 75.0% <0.0%> (ø)
... and 214 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 88c46fc...bbad223. Read the comment docs.

@adizere adizere marked this pull request as ready for review October 16, 2020 15:52
@@ -119,19 +119,3 @@ impl std::fmt::Display for Height {
)
}
}

Copy link
Member Author

Choose a reason for hiding this comment

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

FYI -- These two methods have moved to modules/src/ics24_host/identifier.rs (see below).

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 good! I have some comments, some of them we can address in new issues, I will leave it up to you.

modules/src/ics26_routing/handler.rs Show resolved Hide resolved
modules/src/ics03_connection/handler/conn_open_ack.rs Outdated Show resolved Hide resolved
modules/src/ics03_connection/handler/conn_open_ack.rs Outdated Show resolved Hide resolved
modules/src/ics03_connection/handler/conn_open_try.rs Outdated Show resolved Hide resolved
modules/src/ics03_connection/handler/conn_open_try.rs Outdated Show resolved Hide resolved
modules/src/ics03_connection/handler/verify.rs Outdated Show resolved Hide resolved
modules/src/mock_context.rs Outdated Show resolved Hide resolved
modules/src/mock_context.rs Outdated Show resolved Hide resolved
modules/src/mock_context.rs Outdated Show resolved Hide resolved
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.

Wohooo! Looks great! I think we're good! We can do more in other issues.

@adizere
Copy link
Member Author

adizere commented Oct 20, 2020

Thanks for the thorough review Anca!

@adizere adizere merged commit f0feb0c into master Oct 20, 2020
@adizere adizere deleted the adi/297_mock_cleanup branch October 20, 2020 17:21
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Cleaning up ICS26 tests with global mock context & better coverage.

* ICS26 adapted (ICS18 and general cleanup left todo)

* ICS18 context mock cleanup done.

* Nuked inter-dependent mock contexts

* Housekeeping, last bits.

* Nuked Chain* traits and unused types.

* Addressing Anca's comments from prior PR

* Ressurect is_epoch_format

* Simplify MockContext construction.

* Added mock context validation. Better constructor for ChainId.

* Fixed a few of Anca's comments

* Reintroduced max_history_size in MockContext constructor

* Missing test case for conn_open_try

* Fix host_header arithmetic, added tests for mock context.

* Consistent Height construction. Fixed old comments & error messages
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.

Cleaner context mocks for ICS18 and ICS26
3 participants