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

Change host_height, host_timestamp return value to a Result in ClientReader, ConnectionReader, ChannelReader and ValidationContext #242

Closed
5 tasks
DaviRain-Su opened this issue Nov 16, 2022 · 2 comments · Fixed by #243

Comments

@DaviRain-Su
Copy link
Contributor

Summary

For downstream implementation of ibc-rs interface, host_height, host_timestamp may be wrong, here we suggest to return a Result type.

Problem Definition

Proposal

Acceptance Criteria

change before is

fn host_height(&self) -> Height;
fn host_timestamp(&self) -> Timestamp;

change after is

fn host_height(&self) -> Result<Height, Error>;
fn host_timestamp(&self) -> Result<Timestamp, Error>;

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@plafer
Copy link
Contributor

plafer commented Nov 17, 2022

Could you provide an example scenario where it would be the case that the host cannot provide either its height or timestamp?

@DaviRain-Su
Copy link
Contributor Author

Could you provide an example scenario where it would be the case that the host cannot provide either its height or timestamp?

For downstream implementers to construct Height and timestap here there is a Result type, for the construction of Height returns a Result, my suggestion is that the host_height function returns a Return type of Result. For host_timestamp is similar.

https://github.com/octopus-network/substrate-ibc/blob/6d49011521414b167f05d54bf586a825be4d9a5f/src/module/core/ics02_client.rs#L292

@DaviRain-Su DaviRain-Su changed the title Change host_height, host_timestamp return value in ics02, ics03, ics04 Change host_height, host_timestamp return value to a Result in ClientReader, ConnectionReader, ChannelReader and ValidationContext Nov 21, 2022
@DaviRain-Su DaviRain-Su changed the title Change host_height, host_timestamp return value to a Result in ClientReader, ConnectionReader, ChannelReader and ValidationContext Change host_height, host_timestamp return value to a Result in ClientReader, ConnectionReader, ChannelReader and ValidationContext Nov 21, 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 a pull request may close this issue.

2 participants