Skip to content

Commit

Permalink
fix: Replace Array.equals in javascore xcall
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAndell committed Jan 22, 2024
1 parent fa211ca commit df65822
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,22 @@ private boolean verifyProtocols(String fromNid, String[] protocols, DictDB<Strin
private boolean isReply(String netId, String[] sources) {
if (replyState != null) {
return NetworkAddress.valueOf(replyState.getFrom()).net.equals(netId)
&& Arrays.equals(replyState.getProtocols(), sources);
&& protocolEquals(replyState.getProtocols(), sources);
}

return false;
}

private boolean protocolEquals(String[] a, String[] b) {
for (int i = 0; i < b.length; i++) {
if (!a[i].equals(b[i])) {
return false;
}
}

return true;
}

private byte[] getDataHash(byte[] data) {
return Context.hash("keccak-256", data);
}
Expand Down

0 comments on commit df65822

Please sign in to comment.