diff --git a/cairo-contracts/packages/core/src/channel/components/handler.cairo b/cairo-contracts/packages/core/src/channel/components/handler.cairo index c37c9f87..c24b6136 100644 --- a/cairo-contracts/packages/core/src/channel/components/handler.cairo +++ b/cairo-contracts/packages/core/src/channel/components/handler.cairo @@ -137,7 +137,7 @@ pub mod ChannelHandlerComponent { fn recv_packet_execute( ref self: ComponentState, msg: MsgRecvPacket, chan_end_on_b: ChannelEnd ) { - let app = self.get_app(msg.packet.port_id_on_b.clone()); + let app = self.get_app(@msg.packet.port_id_on_b); let ack = app.on_recv_packet(msg.packet.clone()); @@ -250,7 +250,7 @@ pub mod ChannelHandlerComponent { client_comp.get_client(client_type) } - fn get_app(self: @ComponentState, port_id: PortId) -> ApplicationContract { + fn get_app(self: @ComponentState, port_id: @PortId) -> ApplicationContract { let router_comp = get_dep_component!(self, RouterHandler); router_comp.get_app(port_id) diff --git a/cairo-contracts/packages/core/src/router/component.cairo b/cairo-contracts/packages/core/src/router/component.cairo index e616fc21..bed6641c 100644 --- a/cairo-contracts/packages/core/src/router/component.cairo +++ b/cairo-contracts/packages/core/src/router/component.cairo @@ -30,7 +30,7 @@ pub mod RouterHandlerComponent { fn get_app_address( self: @ComponentState, port_id: ByteArray ) -> Option { - let app_address = self.read_app_address(PortIdImpl::new(port_id)); + let app_address = self.read_app_address(@PortIdImpl::new(port_id)); if app_address.is_non_zero() { Option::Some(app_address) @@ -56,7 +56,7 @@ pub mod RouterHandlerComponent { pub(crate) impl RouterInternalImpl< TContractState, +HasComponent, +Drop > of RouterInternalTrait { - fn get_app(self: @ComponentState, port_id: PortId) -> ApplicationContract { + fn get_app(self: @ComponentState, port_id: @PortId) -> ApplicationContract { let maybe_app_address = self.read_app_address(port_id); assert(maybe_app_address.is_non_zero(), RouterErrors::UNSUPPORTED_PORT_ID); @@ -70,7 +70,7 @@ pub mod RouterHandlerComponent { TContractState, +HasComponent, +Drop > of RouterReaderTrait { fn read_app_address( - self: @ComponentState, port_id: PortId + self: @ComponentState, port_id: @PortId ) -> ContractAddress { self.port_id_to_app.read(port_id.key()) }