From 79a26e8c8338a9fe271632ae0e7bc3e24e909a58 Mon Sep 17 00:00:00 2001 From: Nischal Sharma Date: Tue, 5 Nov 2024 21:38:52 +0530 Subject: [PATCH 1/2] ens contract for Holesky added Signed-off-by: Nischal Sharma --- core/src/main/java/org/web3j/ens/Contracts.java | 3 +++ core/src/main/java/org/web3j/tx/ChainIdLong.java | 1 + core/src/test/java/org/web3j/ens/ContractsTest.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/core/src/main/java/org/web3j/ens/Contracts.java b/core/src/main/java/org/web3j/ens/Contracts.java index 9922e07b9..0b3ad45a6 100644 --- a/core/src/main/java/org/web3j/ens/Contracts.java +++ b/core/src/main/java/org/web3j/ens/Contracts.java @@ -22,6 +22,7 @@ public class Contracts { public static final String RINKEBY = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; public static final String GOERLI = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; public static final String SEPOLIA = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; + public static final String HOLESKY = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"; public static final String LINEA = "0x50130b669B28C339991d8676FA73CF122a121267"; public static final String LINEA_SEPOLIA = "0x5B2636F0f2137B4aE722C01dd5122D7d3e9541f7"; @@ -37,6 +38,8 @@ public static String resolveRegistryContract(String chainId) { return GOERLI; } else if (chainIdLong.equals(ChainIdLong.SEPOLIA)) { return SEPOLIA; + } else if (chainIdLong.equals(ChainIdLong.HOLESKY)) { + return HOLESKY; } else if (chainIdLong.equals(ChainIdLong.LINEA)) { return LINEA; } else if (chainIdLong.equals(ChainIdLong.LINEA_SEPOLIA)) { diff --git a/core/src/main/java/org/web3j/tx/ChainIdLong.java b/core/src/main/java/org/web3j/tx/ChainIdLong.java index 378dca30d..81a8961d7 100644 --- a/core/src/main/java/org/web3j/tx/ChainIdLong.java +++ b/core/src/main/java/org/web3j/tx/ChainIdLong.java @@ -20,6 +20,7 @@ public class ChainIdLong { public static final long RINKEBY = 4; public static final long GOERLI = 5; public static final long SEPOLIA = 11155111; + public static final long HOLESKY = 17000; public static final long ROOTSTOCK_MAINNET = 30; public static final long ROOTSTOCK_TESTNET = 31; public static final long KOVAN = 42; diff --git a/core/src/test/java/org/web3j/ens/ContractsTest.java b/core/src/test/java/org/web3j/ens/ContractsTest.java index 273a5a0b3..2f2cb7e5b 100644 --- a/core/src/test/java/org/web3j/ens/ContractsTest.java +++ b/core/src/test/java/org/web3j/ens/ContractsTest.java @@ -18,6 +18,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.web3j.ens.Contracts.HOLESKY; import static org.web3j.ens.Contracts.LINEA; import static org.web3j.ens.Contracts.LINEA_SEPOLIA; import static org.web3j.ens.Contracts.MAINNET; @@ -35,6 +36,7 @@ public void testResolveRegistryContract() { assertEquals(resolveRegistryContract(ChainIdLong.ROPSTEN + ""), (ROPSTEN)); assertEquals(resolveRegistryContract(ChainIdLong.RINKEBY + ""), (RINKEBY)); assertEquals(resolveRegistryContract(ChainIdLong.SEPOLIA + ""), (SEPOLIA)); + assertEquals(resolveRegistryContract(ChainIdLong.HOLESKY + ""), (HOLESKY)); assertEquals(resolveRegistryContract(ChainIdLong.LINEA + ""), (LINEA)); assertEquals(resolveRegistryContract(ChainIdLong.LINEA_SEPOLIA + ""), (LINEA_SEPOLIA)); } From 36c96a7fdc2ff48caf075902f9da25a0586d3c11 Mon Sep 17 00:00:00 2001 From: Nischal Sharma Date: Tue, 5 Nov 2024 21:42:44 +0530 Subject: [PATCH 2/2] added changelog entry Signed-off-by: Nischal Sharma --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 657fe2ad5..1ac14f931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline * bump snapshot version to 4.12.3 [#2101](https://github.com/hyperledger/web3j/pull/2101) * Add HSM kms implementation [#2105](https://github.com/hyperledger/web3j/pull/2105) +* Added support for Holesky [#2111](https://github.com/hyperledger/web3j/pull/2111) ### BREAKING CHANGES