Closed rnbguy closed 1 week ago
Currently, we have impl From<T> for TmAbciEvent for an event type T. But the other way around is not implemented.
impl From<T> for TmAbciEvent
T
Implement impl TryFrom<TmAbciEvent> for T for all event type T. For example, the CreateClient case:
impl TryFrom<TmAbciEvent> for T
CreateClient
https://github.com/cosmos/ibc-rs/blob/4ea4dcb863efa12f5628a05588e2207112035e4a/ibc-core/ics02-client/types/src/events.rs#L210-L221
The following TryFrom implementation is missing:
TryFrom
impl TryFrom<abci::Event> for CreateClient { type Error = ...; fn try_from(value: abci::Event) -> Result<Self, Self::Error> { (value.kind == CREATE_CLIENT_EVENT) .then(|| { ... }) .ok_or_else(|| { ... }) } }
We should do the same for abci::EventAttribute too. We may need to break this issue into sub-issues for each set of events for: client, connection, channel, packet, host, handler, routing.
abci::EventAttribute
Requested by @penso
Closed by #1253
Feature Summary
Currently, we have
impl From<T> for TmAbciEvent
for an event typeT
. But the other way around is not implemented.Proposal
Implement
impl TryFrom<TmAbciEvent> for T
for all event typeT
. For example, theCreateClient
case:https://github.com/cosmos/ibc-rs/blob/4ea4dcb863efa12f5628a05588e2207112035e4a/ibc-core/ics02-client/types/src/events.rs#L210-L221
The following
TryFrom
implementation is missing:We should do the same for
abci::EventAttribute
too. We may need to break this issue into sub-issues for each set of events for: client, connection, channel, packet, host, handler, routing.Requested by @penso