Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging for Movement events #4147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions voyager/plugins/event-source/movement/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
})
.filter(|(typ, _, _)| typ.name.0.as_str() != "CreateLensClient")
.map(|(typ, data, hash)| {
let event = match dbg!(typ).name.0.as_str() {
let event_type = typ.name.0.as_str();
let event = match event_type {
"CreateClient" => from_raw_event::<ibc::CreateClient>(data),
"UpdateClient" => from_raw_event::<ibc::UpdateClient>(data),
"ConnectionOpenInit" => from_raw_event::<ibc::ConnectionOpenInit>(data),
Expand All @@ -337,6 +338,9 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
"TimeoutPacket" => from_raw_event::<ibc::TimeoutPacket>(data),
unknown => panic!("unknown event `{unknown}`"),
};

info!(event_type = %event_type, tx_hash = %hash, height = %height, "raw movement event");

// TODO: Check the type before deserializing
call(PluginMessage::new(
self.plugin_name(),
Expand Down Expand Up @@ -753,10 +757,10 @@ impl PluginServer<ModuleCall, ModuleCallback> for Module {
events::IbcEvent::TimeoutPacket(_) => todo!(),
};

ibc_union_spec::log_event(&full_event, &self.chain_id);

let voyager_client = e.try_get::<VoyagerClient>()?;

ibc_union_spec::log_event(&full_event, &self.chain_id);

let client_info = voyager_client
.client_info::<IbcUnion>(self.chain_id.clone(), client_id)
.await?;
Expand Down