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

Protobuf trait enforces From<Self> #1473

Open
rnbguy opened this issue Nov 13, 2024 · 1 comment
Open

Protobuf trait enforces From<Self> #1473

rnbguy opened this issue Nov 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rnbguy
Copy link
Member

rnbguy commented Nov 13, 2024

#1456 makes the conversion between tendermint-rs's auto-compiled Google's Duration and core::time::Duration fallible in both direction.

But, the Protobuf trait requires T: From<Self>

pub trait Protobuf<T: Message + From<Self> + Default>

To include the changes for Duration type, this should be refactored to:

 pub trait Protobuf<T: Message + TryFrom<Self> + Default> 

cosmos/ibc-rs#1376 describes a breakage because of this.

@rnbguy rnbguy added the bug Something isn't working label Nov 13, 2024
@rnbguy
Copy link
Member Author

rnbguy commented Nov 13, 2024

I explored the idea of the refactor. But it seems that, it makes encode_vec and encode_length methods infallible - which in turn makes hash, sign_bytes and similar methods in domain types infallible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant