Skip to content

Conversation

@benluelo
Copy link
Contributor

@benluelo benluelo commented Dec 6, 2025

No description provided.

@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
site Ready Ready Preview Comment Dec 6, 2025 1:36am

Comment on lines +352 to +392
if emitted_event.keys[0] == selector!("ConnectionOpenInit") {
let (connection_id, client_id) =
<(NonZero<u32>, NonZero<u32>)>::cairo_deserialize(&emitted_event.keys, 1)
.unwrap();

let counterparty_client_id =
<NonZero<u32>>::cairo_deserialize(&emitted_event.data, 0).unwrap();

let event = CairoIbcEvent::ConnectionOpenInit {
connection_id,
client_id,
counterparty_client_id,
};

dbg!(event, emitted_event);
} else if emitted_event.keys[0] == selector!("ChannelOpenTry") {
let (port_id, channel_id, counterparty_version) =
<(ContractAddress, NonZero<u32>, ByteArray)>::cairo_deserialize(
&emitted_event.keys,
1,
)
.unwrap();

let (counterparty_port_id, counterparty_channel_id, connection_id) =
<(ByteArray, NonZero<u32>, NonZero<u32>)>::cairo_deserialize(
&emitted_event.data,
0,
)
.unwrap();

let event = CairoIbcEvent::ChannelOpenTry {
port_id,
channel_id,
counterparty_port_id,
counterparty_channel_id,
connection_id,
counterparty_version,
};

dbg!(event, emitted_event);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qlp this is the general logic for parsing starknet events, i'm going to pull this out into a library and you can reconsume it in hubble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants