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

Add verify_new_header #102

Closed
wants to merge 1 commit into from

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Dec 23, 2019

Add verify_new_header to combine the verifications of lite client logic when syncing new header.
Changed TrustedState to trait.

Also changed TrustedState to trait
@ebuchman
Copy link
Member

Thanks for this, but take a look at the new approach in #114.

Note sure the Error -> VerifyError is helpful since Verify prefix doesn't really tell us much. We should make some improvements to the error systems though - we've started tracking some ideas in #110 . The impl Display from this PR would be good to preserve too if you want to submit that in another PR. Will close for now, but let us know if you think something else from this should be included.

@ebuchman ebuchman closed this Dec 31, 2019
@yihuang
Copy link
Contributor Author

yihuang commented Dec 31, 2019

The name Error is a conflict with std::error::Error, the Display trait is a requirement of Error trait, that's it.
I'll look at the new approach, thanks.

@tarcieri
Copy link
Contributor

To avoid Error conflicting with std::error::Error, you can refer to the latter using its fully qualified name.

If you use a crate like thiserror to impl Display and std::error::Error using a proc macro, you don't even have to worry about referring to std::error::Error directly, as it will use the proc macro to write the impl for you.

@yihuang
Copy link
Contributor Author

yihuang commented Jan 1, 2020

To avoid Error conflicting with std::error::Error, you can refer to the latter using its fully qualified name.

If you use a crate like thiserror to impl Display and std::error::Error using a proc macro, you don't even have to worry about referring to std::error::Error directly, as it will use the proc macro to write the impl for you.

If you wrap it inside your own Error type, then you can implement whatever trait your need, but if you use the tendermint-rs one directly and hoping it has some trait which is not implemented, there's nothing you can do. I just think there is no reason the Error type is not an instance of std::error::Error.

@tarcieri
Copy link
Contributor

tarcieri commented Jan 1, 2020

It definitely should impl std::error::Error. I'm just saying you don't need to change its name to do that.

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.

3 participants