From 80ca20c93fddf3bcc86a3afc21552fbfd700776d Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:41:40 +0000 Subject: [PATCH 1/3] refactor: load TON chain configuration from yaml store Co-Authored-By: Jayant Krishnamurthy --- .../generate_upgrade_ton_contract_proposal.ts | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/contract_manager/scripts/generate_upgrade_ton_contract_proposal.ts b/contract_manager/scripts/generate_upgrade_ton_contract_proposal.ts index 5fa35f315..277ad611d 100644 --- a/contract_manager/scripts/generate_upgrade_ton_contract_proposal.ts +++ b/contract_manager/scripts/generate_upgrade_ton_contract_proposal.ts @@ -9,7 +9,10 @@ import path from "path"; const parser = yargs(hideBin(process.argv)) .usage( "Upgrades the Pyth contract on TON and creates a governance proposal for it.\n" + - "Usage: $0 --network --contract-address
--ops-key-path " + "Usage: $0 --network --contract-address
--ops-key-path \n" + + "Required environment variables:\n" + + " - ENV_TON_MAINNET_API_KEY: API key for TON mainnet\n" + + " - ENV_TON_TESTNET_API_KEY: API key for TON testnet" ) .options({ network: { @@ -38,16 +41,11 @@ async function main() { const chainId = isMainnet ? CHAINS.ton_mainnet : CHAINS.ton_testnet; const wormholeChainName = toChainName(chainId); - // Get the TON chain instance with appropriate RPC URL based on network - const chain = new TonChain( - chainId.toString(), - isMainnet, - wormholeChainName, - undefined, - isMainnet - ? "https://toncenter.com/api/v2/jsonRPC" - : "https://testnet.toncenter.com/api/v2/jsonRPC" - ); + // Get the TON chain instance from DefaultStore based on network + const chain = DefaultStore.chains[isMainnet ? "ton_mainnet" : "ton_testnet"]; + if (!chain || !(chain instanceof TonChain)) { + throw new Error(`Chain configuration not found for TON ${argv.network}`); + } const vault = DefaultStore.vaults[ From fbbd8bc85d60caaf8377159bace4e012ac467c10 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:50:26 +0000 Subject: [PATCH 2/3] docs: add build command to README Co-Authored-By: Jayant Krishnamurthy --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3f73f3a4a..534ad2a1d 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ after `--`, for instance you could run `pnpm test -- --concurrency 2`. checks, as well as whatever other code checks any packages support. - `pnpm fix`: Run auto fixes, including reformatting code and auto-fixing lint rules where possible. +- `pnpm turbo build`: Build all packages in the monorepo using turborepo. - `pnpm start:dev`: Start all development servers in parallel. - `pnpm start:prod`: Run production builds and start production mode servers in parallel. From 58f900b977976b670054199224afd05ec998233f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:04:23 +0000 Subject: [PATCH 3/3] docs: remove build command from README Co-Authored-By: Jayant Krishnamurthy --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 534ad2a1d..3f73f3a4a 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,6 @@ after `--`, for instance you could run `pnpm test -- --concurrency 2`. checks, as well as whatever other code checks any packages support. - `pnpm fix`: Run auto fixes, including reformatting code and auto-fixing lint rules where possible. -- `pnpm turbo build`: Build all packages in the monorepo using turborepo. - `pnpm start:dev`: Start all development servers in parallel. - `pnpm start:prod`: Run production builds and start production mode servers in parallel.