Skip to content

Commit

Permalink
feat: shadowing
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Jasuwienas <[email protected]>
  • Loading branch information
arianejasuwienas committed Oct 11, 2024
1 parent 872ca1a commit aa694e8
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,15 @@ public boolean hasToAddress() {

public boolean matchesChainId(final byte[] hederaChainId) {
// first two checks handle the unprotected ethereum transactions
// before EIP155 - source: https://eips.ethereum.org/EIPS/eip-155
return chainId == null || chainId.length == 0 || Arrays.compare(chainId, hederaChainId) == 0;
// before EIP155 - source: [https://eips.ethereum.org/EIPS/eip-155](https://eips.ethereum.org/EIPS/eip-155)
if (chainId == null || chainId.length == 0) {
return true;
}

// Convert both chain IDs to BigInteger for comparison
BigInteger parsedHederaChainId = new BigInteger(1, hederaChainId);
BigInteger parsedChainId = new BigInteger(1, chainId);
return parsedHederaChainId.equals(parsedChainId);
}

@VisibleForTesting
Expand Down

0 comments on commit aa694e8

Please sign in to comment.