Open
Description
Following along with the theme of improving error-handling in ibc-rs, we should define a top-level error type in basecoin that will serve as basecoin's host error type for when basecoin errors need to be propagated and handled by ibc-rs.
@rnbguy's example suggestion:
impl<S> ClientValidationContext for IbcContext<S>
where
S: Store + Debug,
{
type HostError = BasecoinError<S>;
...
}
impl<S> ClientExecutionContext for IbcContext<S>
where
S: Store + Debug,
{
fn store_client_state(
&mut self,
client_state_path: ClientStatePath,
client_state: Self::ClientStateMut,
) -> Result<(), ContextError<Self::HostError<S>>> {
self.client_state_store
.set(client_state_path, client_state)
.map(|_| ())
// currently, we forget about the actual host error
// and just do:
// .map_err(|_| ClientError::Other { ... })
.map_err(|err| ClientError::Generic(GenericError::Host(err)))?
Ok(())
}
...
}
Metadata
Assignees
Labels
No labels