From 66a0a163349ae113ad0046ab518f8e0d0ba6d87b Mon Sep 17 00:00:00 2001 From: qwerty0789 Date: Wed, 23 Aug 2023 19:18:06 +0545 Subject: [PATCH 1/2] fix: requiring couterpartyNid to be valid --- .../src/main/java/ibc/xcall/connection/IBCConnection.java | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java b/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java index 504fd8409..03e0e764b 100644 --- a/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java +++ b/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java @@ -250,6 +250,7 @@ public void onChanOpenTry(int order, String[] connectionHops, String portId, Str String counterpartyPortId = counterparty.getPortId(); String counterPartyNid = configuredNetworkIds.at(connectionId).get(counterpartyPortId); Context.require(portId.equals(PORT), "Invalid port"); + Context.require(counterPartyNid!=null, "Invalid counterparty network id"); Context.require(channels.get(counterPartyNid) == null, "Network id is already configured"); lightClients.set(channelId, configuredClients.get(connectionId)); destinationPort.set(channelId, counterpartyPortId); From 4c6d43524ee8f5a4059b517e8cd4b9a991616117 Mon Sep 17 00:00:00 2001 From: AntonAndell Date: Wed, 23 Aug 2023 16:40:33 +0200 Subject: [PATCH 2/2] Fix lint --- .../src/main/java/ibc/xcall/connection/IBCConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java b/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java index 03e0e764b..021366a95 100644 --- a/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java +++ b/contracts/javascore/xcall-connection/src/main/java/ibc/xcall/connection/IBCConnection.java @@ -250,7 +250,7 @@ public void onChanOpenTry(int order, String[] connectionHops, String portId, Str String counterpartyPortId = counterparty.getPortId(); String counterPartyNid = configuredNetworkIds.at(connectionId).get(counterpartyPortId); Context.require(portId.equals(PORT), "Invalid port"); - Context.require(counterPartyNid!=null, "Invalid counterparty network id"); + Context.require(counterPartyNid != null, "Invalid counterparty network id"); Context.require(channels.get(counterPartyNid) == null, "Network id is already configured"); lightClients.set(channelId, configuredClients.get(connectionId)); destinationPort.set(channelId, counterpartyPortId);