Skip to content

Commit

Permalink
solana-ibc: better propagate errors (#75)
Browse files Browse the repository at this point in the history
Avoid unwraps.
  • Loading branch information
mina86 authored Nov 2, 2023
1 parent df07509 commit e08efba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ impl ExecutionContext for IbcStorage<'_, '_> {
let mut store = self.borrow_mut();
let host_height =
ibc::Height::new(store.private.height.0, store.private.height.1)?;
let ibc_event = borsh::to_vec(&event).unwrap();
let ibc_event = borsh::to_vec(&event).map_err(|err| {
ClientError::Other { description: err.to_string() }
})?;
let inner_host_height =
(host_height.revision_height(), host_height.revision_number());
store
Expand Down
1 change: 0 additions & 1 deletion solana/solana-ibc/programs/solana-ibc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
extern crate alloc;

use anchor_lang::prelude::*;
use borsh::{BorshDeserialize, BorshSerialize};
use ibc::core::ics24_host::identifier::PortId;
use ibc::core::router::{Module, ModuleId, Router};

Expand Down

0 comments on commit e08efba

Please sign in to comment.