Skip to content

Commit

Permalink
cloud_functions: get correct core contract
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Jul 8, 2024
1 parent 3024f31 commit 1df5515
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cloud_functions/src/getReobserveVaas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ const MAX_VAAS_TO_REOBSERVE = 25;
export async function convertSolanaTxToAccts(txHash: string): Promise<string[]> {
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,
Expand All @@ -29,7 +28,7 @@ export async function convertSolanaTxToAccts(txHash: string): Promise<string[]>
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 =
Expand Down

0 comments on commit 1df5515

Please sign in to comment.