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

Fix host_height, host_timestamp return value #243

Merged
merged 11 commits into from
Nov 22, 2022

Conversation

DaviRain-Su
Copy link
Contributor

@DaviRain-Su DaviRain-Su commented Nov 16, 2022

Closes: #242

Description


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

Copy link
Contributor

@plafer plafer 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, thanks! Just 2 minor changes to the changelog entry, and we'll get that merged in!

@@ -0,0 +1,2 @@
- Change host_height, host_timestamp return value in ics02, ics03, ics04
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Change host_height, host_timestamp return value in ics02, ics03, ics04
- Change `host_height`, `host_timestamp` return value to a `Result` in `ClientReader`, `ConnectionReader`, and `ChannelReader`

@@ -0,0 +1,2 @@
- Change host_height, host_timestamp return value in ics02, ics03, ics04
Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, can we move this to the .changelog/unreleased/breaking-changes directory?

@plafer
Copy link
Contributor

plafer commented Nov 18, 2022

Also, now that #241 is merged, could you apply the same change to ValidationContext?

@DaviRain-Su
Copy link
Contributor Author

Also, now that #241 is merged, could you apply the same change to ValidationContext?

Done


/// Returns the current timestamp of the local chain.
fn host_timestamp(&self) -> Timestamp {
fn host_timestamp(&self) -> Result<Timestamp, ClientError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

ClientError is not appropriate here, but we don't have a good solution for that at the moment. We would really need some HostError. We can fix this with #164.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would also like to use this way to solve, it is not very clear that the current no_std support is not very perfect

Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

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

🙏

Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

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

Will re-approve after merge conflicts are resolved

@plafer plafer merged commit 7279b4b into cosmos:main Nov 22, 2022
@DaviRain-Su DaviRain-Su deleted the fix-export-api branch November 22, 2022 15:12
Farhad-Shabani pushed a commit that referenced this pull request Sep 9, 2024
* Change host_height, host_timestamp return Value

* fmt code

* Create 242-change-return-value.md

* fix clippy

* update .changelog

* Change host_height, host_timestamp return value in ValidationContext

* update Ics18context to RelayerContext in mock/context.rs

Signed-off-by: Davirain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants