From 1df5515e99ba593f06c7e2b40ffee8b5c99570d5 Mon Sep 17 00:00:00 2001 From: Paul Noel Date: Mon, 8 Jul 2024 09:49:07 -0500 Subject: [PATCH] cloud_functions: get correct core contract --- cloud_functions/src/getReobserveVaas.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cloud_functions/src/getReobserveVaas.ts b/cloud_functions/src/getReobserveVaas.ts index d4a2a1da..ef03dcb3 100644 --- a/cloud_functions/src/getReobserveVaas.ts +++ b/cloud_functions/src/getReobserveVaas.ts @@ -14,10 +14,9 @@ const MAX_VAAS_TO_REOBSERVE = 25; export async function convertSolanaTxToAccts(txHash: string): Promise { const POST_MESSAGE_IX_ID = 0x01; let accounts: string[] = []; + const network = getNetwork(); const endpoint: string = - getNetwork() === 'Mainnet' - ? 'https://api.mainnet-beta.solana.com' - : 'https://api.devnet.solana.com'; + network === 'Mainnet' ? 'https://api.mainnet-beta.solana.com' : 'https://api.devnet.solana.com'; const connection = new Connection(endpoint, 'finalized'); const txs = await connection.getTransactions([txHash], { maxSupportedTransactionVersion: 0, @@ -29,7 +28,7 @@ export async function convertSolanaTxToAccts(txHash: string): Promise const message = tx.transaction.message; const accountKeys = isLegacyMessage(message) ? message.accountKeys : message.staticAccountKeys; const programIdIndex = accountKeys.findIndex( - (i) => i.toBase58() === contracts.coreBridge('Mainnet', 'Solana') + (i) => i.toBase58() === contracts.coreBridge(network, 'Solana') ); const instructions = message.compiledInstructions; const innerInstructions =