@@ -146,17 +146,17 @@ module ibc::ibc {
146
146
const E_PACKET_SEQUENCE_ACK_SEQUENCE_MISMATCH : u64 = 1045 ;
147
147
148
148
#[event]
149
- struct ClientCreatedEvent has copy , drop , store {
149
+ struct CreateClient has copy , drop , store {
150
150
client_id: u32 ,
151
151
client_type: String ,
152
- consensus_height: u64
152
+ counterparty_chain_id: String
153
153
}
154
154
155
155
#[event]
156
- struct ClientUpdated has copy , drop , store {
156
+ struct UpdateClient has copy , drop , store {
157
157
client_id: u32 ,
158
158
client_type: String ,
159
- height : u64
159
+ counterparty_height : u64
160
160
}
161
161
162
162
#[event]
@@ -229,16 +229,20 @@ module ibc::ibc {
229
229
230
230
#[event]
231
231
struct RecvIntentPacket has drop , store {
232
- packet: Packet
232
+ packet: Packet ,
233
+ maker: address ,
234
+ maker_msg: vector <u8 >
233
235
}
234
236
235
237
#[event]
236
- struct RecvPacket has drop , store {
237
- packet: Packet
238
+ struct PacketRecv has drop , store {
239
+ packet: Packet ,
240
+ maker: address ,
241
+ maker_msg: vector <u8 >
238
242
}
239
243
240
244
#[event]
241
- struct SendPacket has drop , store {
245
+ struct PacketSend has drop , store {
242
246
source_channel: u32 ,
243
247
destination_channel: u32 ,
244
248
data: vector <u8 >,
@@ -252,13 +256,14 @@ module ibc::ibc {
252
256
}
253
257
254
258
#[event]
255
- struct AcknowledgePacket has drop , store {
259
+ struct PacketAck has drop , store {
256
260
packet: Packet ,
257
- acknowledgement: vector <u8 >
261
+ acknowledgement: vector <u8 >,
262
+ maker: address ,
258
263
}
259
264
260
265
#[event]
261
- struct WriteAcknowledgement has drop , store {
266
+ struct WriteAck has drop , store {
262
267
packet: Packet ,
263
268
acknowledgement: vector <u8 >
264
269
}
@@ -330,7 +335,7 @@ module ibc::ibc {
330
335
let client_id = generate_client_identifier ();
331
336
let store = borrow_global_mut <IBCStore >(get_vault_addr ());
332
337
333
- let (client_state, consensus_state) =
338
+ let (client_state, consensus_state, counterparty_chain_id ) =
334
339
light_client::create_client (
335
340
client_type,
336
341
&get_ibc_signer (),
@@ -360,7 +365,7 @@ module ibc::ibc {
360
365
);
361
366
362
367
event::emit (
363
- ClientCreatedEvent { client_id, client_type, consensus_height: latest_height }
368
+ CreateClient { client_id, client_type, counterparty_chain_id: counterparty_chain_id }
364
369
);
365
370
}
366
371
@@ -660,7 +665,7 @@ module ibc::ibc {
660
665
hash::sha2_256 (*vector ::borrow (&consensus_states, i))
661
666
);
662
667
663
- event::emit (ClientUpdated { client_id, client_type, height });
668
+ event::emit (UpdateClient { client_id, client_type, counterparty_height: height });
664
669
665
670
i = i + 1 ;
666
671
};
@@ -1032,7 +1037,7 @@ module ibc::ibc {
1032
1037
}
1033
1038
1034
1039
/// Used for sending a packet to the counterparty chain. Note that this doesn't send the packet directly, it prepares the packet
1035
- /// and emits a `SendPacket ` event such that it's being picked up by a relayer.
1040
+ /// and emits a `PacketSend ` event such that it's being picked up by a relayer.
1036
1041
///
1037
1042
/// * `ibc_app`: The signer of the calling contract.
1038
1043
/// * `source_port`: The address of the calling contract.
@@ -1079,7 +1084,7 @@ module ibc::ibc {
1079
1084
);
1080
1085
1081
1086
event::emit (
1082
- SendPacket {
1087
+ PacketSend {
1083
1088
source_channel: source_channel,
1084
1089
destination_channel: channel::counterparty_channel_id (&channel),
1085
1090
data: data,
@@ -1101,11 +1106,11 @@ module ibc::ibc {
1101
1106
) acquires IBCStore {
1102
1107
assert !(!vector ::is_empty (&acknowledgement), E_ACKNOWLEDGEMENT_IS_EMPTY );
1103
1108
1104
- ensure_channel_state (packet::destination_channel (&packet));
1109
+ ensure_channel_state (packet::destination_channel_id (&packet));
1105
1110
1106
1111
let commitment_key =
1107
1112
commitment::batch_receipts_commitment_key (
1108
- packet::destination_channel (&packet),
1113
+ packet::destination_channel_id (&packet),
1109
1114
commitment::commit_packet (&packet)
1110
1115
);
1111
1116
inner_write_acknowledgement (commitment_key, packet, acknowledgement);
@@ -1129,7 +1134,7 @@ module ibc::ibc {
1129
1134
commitment::commit_ack (acknowledgement)
1130
1135
);
1131
1136
1132
- event::emit (WriteAcknowledgement { packet, acknowledgement });
1137
+ event::emit (WriteAck { packet, acknowledgement });
1133
1138
}
1134
1139
1135
1140
public (friend ) fun timeout_packet <T : key + store + drop >(
@@ -1155,8 +1160,8 @@ module ibc::ibc {
1155
1160
packet_timeout_timestamp
1156
1161
);
1157
1162
1158
- let source_channel = packet::source_channel (&packet);
1159
- let destination_channel = packet::destination_channel (&packet);
1163
+ let source_channel = packet::source_channel_id (&packet);
1164
+ let destination_channel = packet::destination_channel_id (&packet);
1160
1165
let channel = ensure_channel_state (source_channel);
1161
1166
let client_id = ensure_connection_state (channel::connection_id (&channel));
1162
1167
let client_type = client_id_to_type (client_id);
@@ -1583,18 +1588,18 @@ module ibc::ibc {
1583
1588
string_utils::to_string (&bcs::to_bytes (&addr))
1584
1589
}
1585
1590
1586
- public (friend ) fun emit_recv_packet (packet: Packet ) {
1587
- event::emit (RecvPacket { packet })
1591
+ public (friend ) fun emit_recv_packet (packet: Packet , maker: address , maker_msg: vector < u8 > ) {
1592
+ event::emit (PacketRecv { packet, maker, maker_msg })
1588
1593
}
1589
1594
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 })
1592
1597
}
1593
1598
1594
1599
public (friend ) fun emit_acknowledge_packet (
1595
- packet: Packet , acknowledgement: vector <u8 >
1600
+ packet: Packet , acknowledgement: vector <u8 >, maker: address
1596
1601
) {
1597
- event::emit (AcknowledgePacket { packet, acknowledgement });
1602
+ event::emit (PacketAck { packet, acknowledgement, maker });
1598
1603
}
1599
1604
1600
1605
// #[test(ibc_signer = @ibc)]
0 commit comments