@@ -149,7 +149,7 @@ module ibc::ibc {
149149 struct CreateClient has copy , drop , store {
150150 client_id: u32 ,
151151 client_type: String ,
152- counterpaty_chain_id : String
152+ counterparty_chain_id : String
153153 }
154154
155155 #[event]
@@ -229,18 +229,22 @@ module ibc::ibc {
229229
230230 #[event]
231231 struct RecvIntentPacket has drop , store {
232- packet: Packet
232+ packet: Packet ,
233+ maker: address ,
234+ maker_msg: vector <u8 >
233235 }
234236
235237 #[event]
236238 struct PacketRecv has drop , store {
237- packet: Packet
239+ packet: Packet ,
240+ maker: address ,
241+ maker_msg: vector <u8 >
238242 }
239243
240244 #[event]
241245 struct PacketSend has drop , store {
242- source_channel_id : u32 ,
243- destination_channel_id : u32 ,
246+ source_channel : u32 ,
247+ destination_channel : u32 ,
244248 data: vector <u8 >,
245249 timeout_height: u64 ,
246250 timeout_timestamp: u64
@@ -254,7 +258,8 @@ module ibc::ibc {
254258 #[event]
255259 struct PacketAck has drop , store {
256260 packet: Packet ,
257- acknowledgement: vector <u8 >
261+ acknowledgement: vector <u8 >,
262+ maker: address ,
258263 }
259264
260265 #[event]
@@ -330,7 +335,7 @@ module ibc::ibc {
330335 let client_id = generate_client_identifier ();
331336 let store = borrow_global_mut <IBCStore >(get_vault_addr ());
332337
333- let (update , counterparty_chain_id) =
338+ let (client_state, consensus_state , counterparty_chain_id) =
334339 light_client::create_client (
335340 client_type,
336341 &get_ibc_signer (),
@@ -348,19 +353,19 @@ module ibc::ibc {
348353 table::upsert (
349354 &mut store.commitments,
350355 commitment::client_state_commitment_key (client_id),
351- update.client_state_commitment
356+ client_state
352357 );
353358
354359 let latest_height = light_client::latest_height (client_type, client_id);
355360
356361 table::upsert (
357362 &mut store.commitments,
358363 commitment::consensus_state_commitment_key (client_id, latest_height),
359- update.consensus_state_commitment
364+ consensus_state
360365 );
361366
362367 event::emit (
363- CreateClient { client_id, client_type, counterpaty_chain_id: latest_height }
368+ CreateClient { client_id, client_type, counterparty_chain_id: counterparty_chain_id }
364369 );
365370 }
366371
@@ -1036,7 +1041,7 @@ module ibc::ibc {
10361041 ///
10371042 /// * `ibc_app`: The signer of the calling contract.
10381043 /// * `source_port`: The address of the calling contract.
1039- /// * `source_channel_id `: The source channel that will be used for sending this packet.
1044+ /// * `source_channel `: The source channel that will be used for sending this packet.
10401045 /// * `timeout_height`: The height in the COUNTERPARTY chain when this packet will time out. `0` means none, but note that both
10411046 /// `timeout_height` and `timeout_timestamp` cannot be `0`.
10421047 /// * `timeout_timestamp`: The timestamp when this packet will time out. `0` means none, but note that both `timeout_height`
@@ -1045,7 +1050,7 @@ module ibc::ibc {
10451050 public fun send_packet (
10461051 ibc_app: &signer ,
10471052 source_port: address ,
1048- source_channel_id : u32 ,
1053+ source_channel : u32 ,
10491054 timeout_height: u64 ,
10501055 timeout_timestamp: u64 ,
10511056 data: vector <u8 >
@@ -1056,21 +1061,21 @@ module ibc::ibc {
10561061 abort E_TIMEOUT_MUST_BE_SET
10571062 };
10581063
1059- let channel = ensure_channel_state (source_channel_id );
1064+ let channel = ensure_channel_state (source_channel );
10601065
10611066 let store = borrow_global_mut <IBCStore >(get_vault_addr ());
10621067
10631068 let packet =
10641069 packet::new (
1065- source_channel_id ,
1070+ source_channel ,
10661071 channel::counterparty_channel_id (&channel),
10671072 data,
10681073 timeout_height,
10691074 timeout_timestamp
10701075 );
10711076 let commitment_key =
10721077 commitment::batch_packets_commitment_key (
1073- source_channel_id , commitment::commit_packet (&packet)
1078+ source_channel , commitment::commit_packet (&packet)
10741079 );
10751080 table::upsert (
10761081 &mut store.commitments,
@@ -1080,8 +1085,8 @@ module ibc::ibc {
10801085
10811086 event::emit (
10821087 PacketSend {
1083- source_channel_id: source_channel_id ,
1084- destination_channel_id : channel::counterparty_channel_id (&channel),
1088+ source_channel: source_channel ,
1089+ destination_channel : channel::counterparty_channel_id (&channel),
10851090 data: data,
10861091 timeout_height: timeout_height,
10871092 timeout_timestamp: timeout_timestamp
@@ -1155,9 +1160,9 @@ module ibc::ibc {
11551160 packet_timeout_timestamp
11561161 );
11571162
1158- let source_channel_id = packet::source_channel_id (&packet);
1159- let destination_channel_id = packet::destination_channel_id (&packet);
1160- let channel = ensure_channel_state (source_channel_id );
1163+ let source_channel = packet::source_channel_id (&packet);
1164+ let destination_channel = packet::destination_channel_id (&packet);
1165+ let channel = ensure_channel_state (source_channel );
11611166 let client_id = ensure_connection_state (channel::connection_id (&channel));
11621167 let client_type = client_id_to_type (client_id);
11631168
@@ -1167,7 +1172,7 @@ module ibc::ibc {
11671172
11681173 let commitment_key =
11691174 commitment::batch_receipts_commitment_key (
1170- destination_channel_id , commitment::commit_packet (&packet)
1175+ destination_channel , commitment::commit_packet (&packet)
11711176 );
11721177 let err =
11731178 verify_absent_commitment (
@@ -1195,7 +1200,7 @@ module ibc::ibc {
11951200
11961201 let commitment_key =
11971202 commitment::batch_packets_commitment_key (
1198- source_channel_id , commitment::commit_packet (&packet)
1203+ source_channel , commitment::commit_packet (&packet)
11991204 );
12001205 table::remove (
12011206 &mut borrow_global_mut <IBCStore >(get_vault_addr ()).commitments,
@@ -1345,12 +1350,12 @@ module ibc::ibc {
13451350 }
13461351
13471352 fun set_next_sequence_recv (
1348- destination_channel_id : u32 , received_sequence: u64
1353+ destination_channel : u32 , received_sequence: u64
13491354 ) acquires IBCStore {
13501355 let store = borrow_global_mut <IBCStore >(get_vault_addr ());
13511356
13521357 let next_sequence_recv_key =
1353- commitment::next_sequence_recv_commitment_key (destination_channel_id );
1358+ commitment::next_sequence_recv_commitment_key (destination_channel );
13541359
13551360 let expected_recv_sequence =
13561361 from_bcs::to_u64 (
@@ -1368,10 +1373,10 @@ module ibc::ibc {
13681373 );
13691374 }
13701375
1371- fun set_next_sequence_ack (source_channel_id : u32 , ack_sequence: u64 ) acquires IBCStore {
1376+ fun set_next_sequence_ack (source_channel : u32 , ack_sequence: u64 ) acquires IBCStore {
13721377 let store = borrow_global_mut <IBCStore >(get_vault_addr ());
13731378
1374- let commitment_key = commitment::next_sequence_ack_commitment_key (source_channel_id );
1379+ let commitment_key = commitment::next_sequence_ack_commitment_key (source_channel );
13751380
13761381 let expected_ack_sequence =
13771382 from_bcs::to_u64 (*table::borrow (&store.commitments, commitment_key));
@@ -1583,18 +1588,18 @@ module ibc::ibc {
15831588 string_utils::to_string (&bcs::to_bytes (&addr))
15841589 }
15851590
1586- public (friend ) fun emit_recv_packet (packet: Packet ) {
1587- event::emit (PacketRecv { packet })
1591+ public (friend ) fun emit_recv_packet (packet: Packet , maker: address , maker_msg: vector < u8 > ) {
1592+ event::emit (PacketRecv { packet, maker, maker_msg })
15881593 }
15891594
1590- public (friend ) fun emit_recv_intent_packet (packet: Packet ) {
1591- event::emit (RecvIntentPacket { packet })
1595+ public (friend ) fun emit_recv_intent_packet (packet: Packet , maker: address , maker_msg: vector < u8 > ) {
1596+ event::emit (RecvIntentPacket { packet, maker, maker_msg })
15921597 }
15931598
15941599 public (friend ) fun emit_acknowledge_packet (
1595- packet: Packet , acknowledgement: vector <u8 >
1600+ packet: Packet , acknowledgement: vector <u8 >, maker: address
15961601 ) {
1597- event::emit (PacketAck { packet, acknowledgement });
1602+ event::emit (PacketAck { packet, acknowledgement, maker });
15981603 }
15991604
16001605 // #[test(ibc_signer = @ibc)]
0 commit comments