fix(contract-manager): support networkId serialization in TonChain config - #3853
fix(contract-manager): support networkId serialization in TonChain config#3853Ysh204 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@Ysh204 is attempting to deploy a commit to the Pyth Network Team on Vercel. A member of the Team first needs to authorize it. |
| wormholeChainName: string, | ||
| nativeToken: TokenId | undefined, | ||
| private rpcUrl: string, | ||
| private networkId: string, |
There was a problem hiding this comment.
🚩 networkId field is added but never consumed by any TonChain logic
The new networkId field (contract_manager/src/core/chains.ts:1522) is stored and serialized/deserialized but is never referenced by any method in TonChain or in any TON contract code (contract_manager/src/core/contracts/ton.ts). By contrast, NearChain uses its networkId in getNearAccount() at contract_manager/src/core/chains.ts:1698 and contract_manager/src/core/chains.ts:1702. This isn't a bug — the commit message says "add missing networkId serialization" suggesting the field is needed for data completeness or future use — but it's worth confirming the intended consumer exists or is planned.
Was this helpful? React with 👍 or 👎 to provide feedback.
| { | ||
| "id": "ton_testnet", | ||
| "mainnet": false, | ||
| "networkId": "0x2", |
There was a problem hiding this comment.
🚩 Verify correctness of TON networkId values (0x2 and 0x27)
The JSON config uses "0x2" (decimal 2) for testnet and "0x27" (decimal 39) for mainnet. These don't correspond to standard TON global IDs (mainnet = -239, testnet = -3), nor to the Wormhole chain IDs for TON (ton_mainnet = 60069, ton_testnet = 50104 per governance/xc_admin/packages/xc_admin_common/src/chains.ts:102,243). They also don't match the NearChain convention of using human-readable names like "testnet" and "mainnet". Since the field isn't consumed yet, incorrect values won't cause runtime failures today, but they should be verified before any logic depends on them.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Thanks for the review! The If the project expects different identifiers for TON, or follows a different convention for |
Summary
Fixes #3652 by adding missing
networkIdvalues for TON chain configurations and ensuring they are preserved during serialization.Changes
Add
networkIdvalues tocontract_manager/src/store/chains/TonChains.json:0x2for TON Testnet0x27for TON MainnetUpdate
TonChainserialization to preservenetworkIdthrough:fromJson(),toJson().Verification
npx turbo run build.Fixes #3652