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

Avoid unwrap() for Height conversion #301

Merged
merged 1 commit into from
Oct 12, 2020
Merged

Avoid unwrap() for Height conversion #301

merged 1 commit into from
Oct 12, 2020

Conversation

adizere
Copy link
Member

@adizere adizere commented Oct 9, 2020

Closes: #300

This fixes most of the try_into().unwrap() around Height type conversion. The unwraps were recently necessary for a quick alignment with tendermint-rs changes in Height type.

Several uses of try_into().unwrap() still exist in our code in places where it was difficult to fix (some in relayer-cli) or places which are currently in flux (context mocks, which will be removed soon).

Description


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 9, 2020
@codecov-io
Copy link

Codecov Report

Merging #301 into master will increase coverage by 23.3%.
The diff coverage is 61.8%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #301      +/-   ##
=========================================
+ Coverage    13.6%   37.0%   +23.3%     
=========================================
  Files          69     120      +51     
  Lines        3752    7788    +4036     
  Branches     1374    2785    +1411     
=========================================
+ Hits          513    2885    +2372     
- Misses       2618    4586    +1968     
+ Partials      621     317     -304     
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/context.rs 0.0% <0.0%> (ø)
modules/src/ics03_connection/error.rs 16.6% <0.0%> (-16.7%) ⬇️
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%> (ø)
... and 218 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 e3a8384...5fef182. Read the comment docs.

@adizere adizere marked this pull request as ready for review October 12, 2020 08:44
Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

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

Thanks @adizere!

@adizere adizere merged commit c3c5704 into master Oct 12, 2020
@adizere adizere deleted the adi/300_height_conv branch October 12, 2020 09:09
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
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.

Better type conversion into Height
3 participants