Skip to content

Commit 1df5515

Browse files
committedJul 8, 2024·
cloud_functions: get correct core contract
1 parent 3024f31 commit 1df5515

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎cloud_functions/src/getReobserveVaas.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ const MAX_VAAS_TO_REOBSERVE = 25;
1414
export async function convertSolanaTxToAccts(txHash: string): Promise<string[]> {
1515
const POST_MESSAGE_IX_ID = 0x01;
1616
let accounts: string[] = [];
17+
const network = getNetwork();
1718
const endpoint: string =
18-
getNetwork() === 'Mainnet'
19-
? 'https://api.mainnet-beta.solana.com'
20-
: 'https://api.devnet.solana.com';
19+
network === 'Mainnet' ? 'https://api.mainnet-beta.solana.com' : 'https://api.devnet.solana.com';
2120
const connection = new Connection(endpoint, 'finalized');
2221
const txs = await connection.getTransactions([txHash], {
2322
maxSupportedTransactionVersion: 0,
@@ -29,7 +28,7 @@ export async function convertSolanaTxToAccts(txHash: string): Promise<string[]>
2928
const message = tx.transaction.message;
3029
const accountKeys = isLegacyMessage(message) ? message.accountKeys : message.staticAccountKeys;
3130
const programIdIndex = accountKeys.findIndex(
32-
(i) => i.toBase58() === contracts.coreBridge('Mainnet', 'Solana')
31+
(i) => i.toBase58() === contracts.coreBridge(network, 'Solana')
3332
);
3433
const instructions = message.compiledInstructions;
3534
const innerInstructions =

0 commit comments

Comments
 (0)
Please sign in to comment.