This should be avoided as this doesn't work with a TryFrom impl with a different error type.
Details
That TryFrom<T, Error = ClientError> should be TryFrom<T, Error: Into<ClientError>>. But we can't do this until associated-type-bounds stabilizes. This should be the case for ClientStateDecoder and Covertible too.
As an alternative, we can add where <Self as TryFrom<Any>>::Error: Into<ClientError> - but we end up adding this bound in every impl and method signature. This can be avoided when implied-bounds stabilizes.
Bug Summary
Currently
ClientStateDecoder
,ConsensusStateDecoder
andConvertible
takesClientError
forTryFrom::Error
or a genericE
forTryInto::Error
.https://github.com/cosmos/ibc-rs/blob/67d0735d3acc41ddadf8b20eb4b77c02f3707435/ibc-core/ics02-client/context/src/consensus_state.rs#L11
https://github.com/cosmos/ibc-rs/blob/67d0735d3acc41ddadf8b20eb4b77c02f3707435/ibc-core/ics02-client/context/src/client_state.rs#L15
https://github.com/cosmos/ibc-rs/blob/67d0735d3acc41ddadf8b20eb4b77c02f3707435/ibc-core/ics02-client/context/src/context.rs#L161
This should be avoided as this doesn't work with a
TryFrom
impl with a different error type.Details
That
TryFrom<T, Error = ClientError>
should beTryFrom<T, Error: Into<ClientError>>
. But we can't do this until associated-type-bounds stabilizes. This should be the case forClientStateDecoder
andCovertible
too.As an alternative, we can add
where <Self as TryFrom<Any>>::Error: Into<ClientError>
- but we end up adding this bound in everyimpl
andmethod
signature. This can be avoided when implied-bounds stabilizes.Version