Skip to content

Commit 401cc21

Browse files
crStivUser
authored and
User
committed
fix(movement): use ibc_union_spec::log_event for logging events
Update main.rs Update main.rs Update main.rs
1 parent 7f736a0 commit 401cc21

File tree

1 file changed

+7
-3
lines changed
  • voyager/plugins/event-source/movement/src

1 file changed

+7
-3
lines changed

voyager/plugins/event-source/movement/src/main.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
317317
})
318318
.filter(|(typ, _, _)| typ.name.0.as_str() != "CreateLensClient")
319319
.map(|(typ, data, hash)| {
320-
let event = match dbg!(typ).name.0.as_str() {
320+
let event_type = typ.name.0.as_str();
321+
let event = match event_type {
321322
"CreateClient" => from_raw_event::<ibc::CreateClient>(data),
322323
"UpdateClient" => from_raw_event::<ibc::UpdateClient>(data),
323324
"ConnectionOpenInit" => from_raw_event::<ibc::ConnectionOpenInit>(data),
@@ -337,6 +338,9 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
337338
"TimeoutPacket" => from_raw_event::<ibc::TimeoutPacket>(data),
338339
unknown => panic!("unknown event `{unknown}`"),
339340
};
341+
342+
info!(event_type = %event_type, tx_hash = %hash, height = %height, "raw movement event");
343+
340344
// TODO: Check the type before deserializing
341345
call(PluginMessage::new(
342346
self.plugin_name(),
@@ -753,10 +757,10 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
753757
events::IbcEvent::TimeoutPacket(_) => todo!(),
754758
};
755759

756-
ibc_union_spec::log_event(&full_event, &self.chain_id);
757-
758760
let voyager_client = e.try_get::<VoyagerClient>()?;
759761

762+
ibc_union_spec::log_event(&full_event, &self.chain_id);
763+
760764
let client_info = voyager_client
761765
.client_info::<IbcUnion>(self.chain_id.clone(), client_id)
762766
.await?;

0 commit comments

Comments
 (0)