Skip to content

Commit 98594ae

Browse files
imp(ics04): sync naming for channel events with the convention (#751)
1 parent c64df10 commit 98594ae

File tree

7 files changed

+466
-470
lines changed

7 files changed

+466
-470
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Sync field and method namings of ics04 events with the convention
2+
([#750](https://github.com/cosmos/ibc-rs/issues/750))

crates/ibc/src/core/ics03_connection/events.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ impl OpenInit {
9999
})
100100
}
101101

102-
pub fn connection_id(&self) -> &ConnectionId {
102+
pub fn conn_id_on_a(&self) -> &ConnectionId {
103103
&self.0.connection_id
104104
}
105-
pub fn client_id(&self) -> &ClientId {
105+
pub fn client_id_on_a(&self) -> &ClientId {
106106
&self.0.client_id
107107
}
108-
pub fn counterparty_connection_id(&self) -> Option<&ConnectionId> {
108+
pub fn conn_id_on_b(&self) -> Option<&ConnectionId> {
109109
self.0.counterparty_connection_id.as_ref()
110110
}
111-
pub fn counterparty_client_id(&self) -> &ClientId {
111+
pub fn client_id_on_b(&self) -> &ClientId {
112112
&self.0.counterparty_client_id
113113
}
114114

@@ -158,16 +158,16 @@ impl OpenTry {
158158
})
159159
}
160160

161-
pub fn connection_id(&self) -> &ConnectionId {
161+
pub fn conn_id_on_b(&self) -> &ConnectionId {
162162
&self.0.connection_id
163163
}
164-
pub fn client_id(&self) -> &ClientId {
164+
pub fn client_id_on_b(&self) -> &ClientId {
165165
&self.0.client_id
166166
}
167-
pub fn counterparty_connection_id(&self) -> Option<&ConnectionId> {
167+
pub fn conn_id_on_a(&self) -> Option<&ConnectionId> {
168168
self.0.counterparty_connection_id.as_ref()
169169
}
170-
pub fn counterparty_client_id(&self) -> &ClientId {
170+
pub fn client_id_on_a(&self) -> &ClientId {
171171
&self.0.counterparty_client_id
172172
}
173173

@@ -217,16 +217,16 @@ impl OpenAck {
217217
})
218218
}
219219

220-
pub fn connection_id(&self) -> &ConnectionId {
220+
pub fn conn_id_on_a(&self) -> &ConnectionId {
221221
&self.0.connection_id
222222
}
223-
pub fn client_id(&self) -> &ClientId {
223+
pub fn client_id_on_a(&self) -> &ClientId {
224224
&self.0.client_id
225225
}
226-
pub fn counterparty_connection_id(&self) -> Option<&ConnectionId> {
226+
pub fn conn_id_on_b(&self) -> Option<&ConnectionId> {
227227
self.0.counterparty_connection_id.as_ref()
228228
}
229-
pub fn counterparty_client_id(&self) -> &ClientId {
229+
pub fn client_id_on_b(&self) -> &ClientId {
230230
&self.0.counterparty_client_id
231231
}
232232

@@ -276,16 +276,16 @@ impl OpenConfirm {
276276
})
277277
}
278278

279-
pub fn connection_id(&self) -> &ConnectionId {
279+
pub fn conn_id_on_b(&self) -> &ConnectionId {
280280
&self.0.connection_id
281281
}
282-
pub fn client_id(&self) -> &ClientId {
282+
pub fn client_id_on_b(&self) -> &ClientId {
283283
&self.0.client_id
284284
}
285-
pub fn counterparty_connection_id(&self) -> Option<&ConnectionId> {
285+
pub fn conn_id_on_a(&self) -> Option<&ConnectionId> {
286286
self.0.counterparty_connection_id.as_ref()
287287
}
288-
pub fn counterparty_client_id(&self) -> &ClientId {
288+
pub fn client_id_on_a(&self) -> &ClientId {
289289
&self.0.counterparty_client_id
290290
}
291291

crates/ibc/src/core/ics03_connection/handler/conn_open_ack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ mod tests {
340340
};
341341
let conn_end = <MockContext as ValidationContext>::connection_end(
342342
&fxt.ctx,
343-
conn_open_try_event.connection_id(),
343+
conn_open_try_event.conn_id_on_a(),
344344
)
345345
.unwrap();
346346
assert_eq!(conn_end.state().clone(), State::Open);

crates/ibc/src/core/ics03_connection/handler/conn_open_confirm.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,9 @@ mod tests {
258258
IbcEvent::OpenConfirmConnection(e) => e,
259259
_ => unreachable!(),
260260
};
261-
let conn_end = ValidationContext::connection_end(
262-
&fxt.ctx,
263-
conn_open_try_event.connection_id(),
264-
)
265-
.unwrap();
261+
let conn_end =
262+
ValidationContext::connection_end(&fxt.ctx, conn_open_try_event.conn_id_on_b())
263+
.unwrap();
266264
assert_eq!(conn_end.state().clone(), State::Open);
267265
}
268266
}

crates/ibc/src/core/ics03_connection/handler/conn_open_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ mod tests {
169169
};
170170
let conn_end = ValidationContext::connection_end(
171171
&fxt.ctx,
172-
conn_open_init_event.connection_id(),
172+
conn_open_init_event.conn_id_on_a(),
173173
)
174174
.unwrap();
175175
assert_eq!(conn_end.state().clone(), State::Init);

crates/ibc/src/core/ics03_connection/handler/conn_open_try.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,9 @@ mod tests {
306306
IbcEvent::OpenTryConnection(e) => e,
307307
_ => unreachable!(),
308308
};
309-
let conn_end = ValidationContext::connection_end(
310-
&fxt.ctx,
311-
conn_open_try_event.connection_id(),
312-
)
313-
.unwrap();
309+
let conn_end =
310+
ValidationContext::connection_end(&fxt.ctx, conn_open_try_event.conn_id_on_b())
311+
.unwrap();
314312
assert_eq!(conn_end.state().clone(), State::TryOpen);
315313
}
316314
}

0 commit comments

Comments
 (0)