From 465b6493b1b70eefd1c4529f3b1bd92ee6cec92a Mon Sep 17 00:00:00 2001 From: Edgars Date: Sat, 7 Feb 2026 22:21:12 +0000 Subject: [PATCH 1/2] Update testnet Asimov to phase4 deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RPC URL → zksync-os-testnet-genlayer.zksync.dev - Add WSS endpoint - Update ConsensusMain, ConsensusData, Staking addresses - Add smoke tests for chain config and RPC connectivity --- src/chains/testnetAsimov.ts | 10 ++++--- tests/smoke.test.ts | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 tests/smoke.test.ts diff --git a/src/chains/testnetAsimov.ts b/src/chains/testnetAsimov.ts index 433397e..0216dc4 100644 --- a/src/chains/testnetAsimov.ts +++ b/src/chains/testnetAsimov.ts @@ -3,15 +3,16 @@ import {GenLayerChain} from "@/types"; import {STAKING_ABI} from "@/abi/staking"; // chains/localnet.ts -const TESTNET_JSON_RPC_URL = "https://genlayer-testnet.rpc.caldera.xyz/http"; +const TESTNET_JSON_RPC_URL = "https://zksync-os-testnet-genlayer.zksync.dev"; +const TESTNET_WS_URL = "wss://zksync-os-testnet-alpha.zksync.dev/ws"; const STAKING_CONTRACT = { - address: "0x03f410748EBdb4026a6b8299E9B6603A273709D1" as Address, + address: "0x63Fa5E0bb10fb6fA98F44726C5518223F767687A" as Address, abi: STAKING_ABI, }; const EXPLORER_URL = "https://explorer-asimov.genlayer.com/"; const CONSENSUS_MAIN_CONTRACT = { - address: "0x67fd4aC71530FB220E0B7F90668BAF977B88fF07" as Address, + address: "0x6CAFF6769d70824745AD895663409DC70aB5B28E" as Address, abi: [ { inputs: [], @@ -1401,7 +1402,7 @@ const CONSENSUS_MAIN_CONTRACT = { }; const CONSENSUS_DATA_CONTRACT = { - address: "0xB6E1316E57d47d82FDcEa5002028a554754EF243" as Address, + address: "0x0D9d1d74d72Fa5eB94bcf746C8FCcb312a722c9B" as Address, abi: [ { inputs: [], @@ -3989,6 +3990,7 @@ export const testnetAsimov: GenLayerChain = defineChain({ rpcUrls: { default: { http: [TESTNET_JSON_RPC_URL], + webSocket: [TESTNET_WS_URL], }, }, nativeCurrency: { diff --git a/tests/smoke.test.ts b/tests/smoke.test.ts new file mode 100644 index 0000000..7da8366 --- /dev/null +++ b/tests/smoke.test.ts @@ -0,0 +1,59 @@ +// tests/smoke.test.ts +// Basic smoke tests to verify testnet chain configuration and connectivity +import {describe, it, expect} from "vitest"; +import {testnetAsimov} from "@/chains/testnetAsimov"; +import {createPublicClient, http} from "viem"; + +describe("Testnet Asimov Chain Config", () => { + it("should have valid RPC URL", () => { + const rpcUrl = testnetAsimov.rpcUrls.default.http[0]; + expect(rpcUrl).toBe("https://zksync-os-testnet-genlayer.zksync.dev"); + }); + + it("should have valid WebSocket URL", () => { + const wsUrl = testnetAsimov.rpcUrls.default.webSocket?.[0]; + expect(wsUrl).toBe("wss://zksync-os-testnet-alpha.zksync.dev/ws"); + }); + + it("should have consensus main contract address", () => { + expect(testnetAsimov.consensusMainContract.address).toBe( + "0x6CAFF6769d70824745AD895663409DC70aB5B28E", + ); + }); + + it("should have consensus data contract address", () => { + expect(testnetAsimov.consensusDataContract.address).toBe( + "0x0D9d1d74d72Fa5eB94bcf746C8FCcb312a722c9B", + ); + }); + + it("should have staking contract address", () => { + expect(testnetAsimov.stakingContract?.address).toBe( + "0x63Fa5E0bb10fb6fA98F44726C5518223F767687A", + ); + }); + + it("should have correct chain ID", () => { + expect(testnetAsimov.id).toBe(0x107d); + }); +}); + +describe("Testnet Asimov RPC Connectivity", () => { + it("should connect and fetch chain ID", async () => { + const client = createPublicClient({ + chain: testnetAsimov, + transport: http(testnetAsimov.rpcUrls.default.http[0]), + }); + const chainId = await client.getChainId(); + expect(chainId).toBe(testnetAsimov.id); + }, 15000); + + it("should fetch latest block number", async () => { + const client = createPublicClient({ + chain: testnetAsimov, + transport: http(testnetAsimov.rpcUrls.default.http[0]), + }); + const blockNumber = await client.getBlockNumber(); + expect(blockNumber).toBeGreaterThan(0n); + }, 15000); +}); From 47ff210d5e091c0b7ebec7a350c8cd1f321fafcb Mon Sep 17 00:00:00 2001 From: Edgars Date: Sat, 7 Feb 2026 22:24:11 +0000 Subject: [PATCH 2/2] Fix nullable type access in smoke tests --- tests/smoke.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/smoke.test.ts b/tests/smoke.test.ts index 7da8366..418d49f 100644 --- a/tests/smoke.test.ts +++ b/tests/smoke.test.ts @@ -16,13 +16,13 @@ describe("Testnet Asimov Chain Config", () => { }); it("should have consensus main contract address", () => { - expect(testnetAsimov.consensusMainContract.address).toBe( + expect(testnetAsimov.consensusMainContract?.address).toBe( "0x6CAFF6769d70824745AD895663409DC70aB5B28E", ); }); it("should have consensus data contract address", () => { - expect(testnetAsimov.consensusDataContract.address).toBe( + expect(testnetAsimov.consensusDataContract?.address).toBe( "0x0D9d1d74d72Fa5eB94bcf746C8FCcb312a722c9B", ); });