Skip to content

Commit 1b79c69

Browse files
committed
Log all IBC transaction error
1 parent a4480a4 commit 1b79c69

File tree

1 file changed

+17
-7
lines changed
  • core/src/ibc/transaction_handler

1 file changed

+17
-7
lines changed

core/src/ibc/transaction_handler/mod.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ use ibc::context as ibc_context;
2929
use rlp::{Decodable, Rlp};
3030

3131
pub fn execute(
32+
bytes: &[u8],
33+
state: &mut TopLevelState,
34+
fee_payer: &Address,
35+
sender_public: &Public,
36+
current_block_number: u64,
37+
) -> StateResult<()> {
38+
let result = execute_inner(bytes, state, fee_payer, sender_public, current_block_number);
39+
40+
if let Err(err) = &result {
41+
cwarn!(IBC, "Executing datagram failed: {:?}", err);
42+
}
43+
44+
result
45+
}
46+
47+
fn execute_inner(
3248
bytes: &[u8],
3349
state: &mut TopLevelState,
3450
_fee_payer: &Address,
@@ -49,7 +65,7 @@ pub fn execute(
4965
}
5066
}
5167

52-
let result = match datagram {
68+
match datagram {
5369
Datagram::CreateClient {
5470
id,
5571
kind,
@@ -248,11 +264,5 @@ pub fn execute(
248264
.map_err(|err| RuntimeError::IBC(format!("AcknowledgePacket: {}", err)))?;
249265
Ok(())
250266
}
251-
};
252-
253-
if let Err(err) = &result {
254-
cwarn!(IBC, "Executing datagram failed: {:?}", err);
255267
}
256-
257-
result
258268
}

0 commit comments

Comments
 (0)