@@ -78,7 +78,6 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
78
78
channel.connectionId = msg_.connectionId;
79
79
channel.ordering = msg_.ordering;
80
80
channel.version = msg_.version;
81
- channel.portId = msg_.portId.toHexString ();
82
81
channel.counterpartyPortId = msg_.counterpartyPortId;
83
82
initializeChannelSequences (channelId);
84
83
commitChannel (channelId, channel);
@@ -91,7 +90,7 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
91
90
msg_.relayer
92
91
);
93
92
emit IBCChannelLib.ChannelOpenInit (
94
- channel .portId,
93
+ msg_ .portId. toHexString () ,
95
94
channelId,
96
95
channel.counterpartyPortId,
97
96
msg_.connectionId,
@@ -121,8 +120,7 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
121
120
ordering: msg_.channel.ordering,
122
121
counterpartyChannelId: 0 ,
123
122
connectionId: getCounterpartyConnection (msg_.channel.connectionId),
124
- portId: msg_.channel.counterpartyPortId,
125
- counterpartyPortId: msg_.channel.portId,
123
+ counterpartyPortId: msg_.portId.toHexString (),
126
124
version: msg_.counterpartyVersion
127
125
});
128
126
if (
@@ -140,9 +138,8 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
140
138
channels[channelId] = msg_.channel;
141
139
initializeChannelSequences (channelId);
142
140
commitChannelCalldata (channelId, msg_.channel);
143
- address portId = Hex.hexToAddress (msg_.channel.portId);
144
- claimChannel (portId, channelId);
145
- IIBCModule (portId).onChanOpenTry (
141
+ claimChannel (msg_.portId, channelId);
142
+ IIBCModule (msg_.portId).onChanOpenTry (
146
143
msg_.channel.ordering,
147
144
msg_.channel.connectionId,
148
145
channelId,
@@ -152,7 +149,7 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
152
149
msg_.relayer
153
150
);
154
151
emit IBCChannelLib.ChannelOpenTry (
155
- msg_.channel. portId,
152
+ msg_.portId. toHexString () ,
156
153
channelId,
157
154
msg_.channel.counterpartyPortId,
158
155
msg_.channel.counterpartyChannelId,
@@ -173,13 +170,13 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
173
170
revert IBCErrors.ErrInvalidChannelState ();
174
171
}
175
172
uint32 clientId = ensureConnectionState (channel.connectionId);
173
+ address portId = channelOwner[msg_.channelId];
176
174
IBCChannel memory expectedChannel = IBCChannel ({
177
175
state: IBCChannelState.TryOpen,
178
176
ordering: channel.ordering,
179
177
counterpartyChannelId: msg_.channelId,
180
178
connectionId: getCounterpartyConnection (channel.connectionId),
181
- portId: channel.counterpartyPortId,
182
- counterpartyPortId: channel.portId,
179
+ counterpartyPortId: portId.toHexString (),
183
180
version: msg_.counterpartyVersion
184
181
});
185
182
if (
@@ -197,14 +194,14 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
197
194
channel.version = msg_.counterpartyVersion;
198
195
channel.counterpartyChannelId = msg_.counterpartyChannelId;
199
196
commitChannel (msg_.channelId, channel);
200
- IIBCModule (Hex. hexToAddress (channel. portId) ).onChanOpenAck (
197
+ IIBCModule (portId).onChanOpenAck (
201
198
msg_.channelId,
202
199
msg_.counterpartyChannelId,
203
200
msg_.counterpartyVersion,
204
201
msg_.relayer
205
202
);
206
203
emit IBCChannelLib.ChannelOpenAck (
207
- channel. portId,
204
+ portId. toHexString () ,
208
205
msg_.channelId,
209
206
channel.counterpartyPortId,
210
207
msg_.counterpartyChannelId,
@@ -223,13 +220,13 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
223
220
revert IBCErrors.ErrInvalidChannelState ();
224
221
}
225
222
uint32 clientId = ensureConnectionState (channel.connectionId);
223
+ address portId = channelOwner[msg_.channelId];
226
224
IBCChannel memory expectedChannel = IBCChannel ({
227
225
state: IBCChannelState.Open,
228
226
ordering: channel.ordering,
229
227
counterpartyChannelId: msg_.channelId,
230
228
connectionId: getCounterpartyConnection (channel.connectionId),
231
- portId: channel.counterpartyPortId,
232
- counterpartyPortId: channel.portId,
229
+ counterpartyPortId: portId.toHexString (),
233
230
version: channel.version
234
231
});
235
232
if (
@@ -245,11 +242,9 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
245
242
}
246
243
channel.state = IBCChannelState.Open;
247
244
commitChannel (msg_.channelId, channel);
248
- IIBCModule (Hex.hexToAddress (channel.portId)).onChanOpenConfirm (
249
- msg_.channelId, msg_.relayer
250
- );
245
+ IIBCModule (portId).onChanOpenConfirm (msg_.channelId, msg_.relayer);
251
246
emit IBCChannelLib.ChannelOpenConfirm (
252
- channel. portId,
247
+ portId. toHexString () ,
253
248
msg_.channelId,
254
249
channel.counterpartyPortId,
255
250
channel.counterpartyChannelId,
@@ -270,11 +265,10 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
270
265
ensureConnectionState (channel.connectionId);
271
266
channel.state = IBCChannelState.Closed;
272
267
commitChannel (msg_.channelId, channel);
273
- IIBCModule (Hex.hexToAddress (channel.portId)).onChanCloseInit (
274
- msg_.channelId, msg_.relayer
275
- );
268
+ address portId = channelOwner[msg_.channelId];
269
+ IIBCModule (portId).onChanCloseInit (msg_.channelId, msg_.relayer);
276
270
emit IBCChannelLib.ChannelCloseInit (
277
- channel. portId,
271
+ portId. toHexString () ,
278
272
msg_.channelId,
279
273
channel.counterpartyPortId,
280
274
channel.counterpartyChannelId
@@ -293,13 +287,13 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
293
287
revert IBCErrors.ErrInvalidChannelState ();
294
288
}
295
289
uint32 clientId = ensureConnectionState (channel.connectionId);
290
+ address portId = channelOwner[msg_.channelId];
296
291
IBCChannel memory expectedChannel = IBCChannel ({
297
292
state: IBCChannelState.Closed,
298
293
ordering: channel.ordering,
299
294
counterpartyChannelId: msg_.channelId,
300
295
connectionId: getCounterpartyConnection (channel.connectionId),
301
- portId: channel.counterpartyPortId,
302
- counterpartyPortId: channel.portId,
296
+ counterpartyPortId: portId.toHexString (),
303
297
version: channel.version
304
298
});
305
299
if (
@@ -315,11 +309,9 @@ abstract contract IBCChannelImpl is IBCStore, IIBCChannel {
315
309
}
316
310
channel.state = IBCChannelState.Closed;
317
311
commitChannel (msg_.channelId, channel);
318
- IIBCModule (Hex.hexToAddress (channel.portId)).onChanCloseConfirm (
319
- msg_.channelId, msg_.relayer
320
- );
312
+ IIBCModule (portId).onChanCloseConfirm (msg_.channelId, msg_.relayer);
321
313
emit IBCChannelLib.ChannelCloseConfirm (
322
- channel. portId,
314
+ portId. toHexString () ,
323
315
msg_.channelId,
324
316
channel.counterpartyPortId,
325
317
channel.counterpartyChannelId
0 commit comments