Skip to content

Commit 11cbd1b

Browse files
committed
cloud_functions: update wormholescanRPC for testnet
1 parent 1df5515 commit 11cbd1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cloud_functions/src/utils.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export const padUint16 = (s: string): string => s.padStart(MAX_UINT_16.length, '
1414
const MAX_UINT_64 = '18446744073709551615';
1515
export const padUint64 = (s: string): string => s.padStart(MAX_UINT_64.length, '0');
1616

17-
export const WormholescanRPC: string = 'https://api.wormholescan.io/';
17+
export const WormholescanRPC: { [key in Network]?: string } = {
18+
['Mainnet']: 'https://api.wormholescan.io/',
19+
['Testnet']: 'https://api.testnet.wormholescan.io/',
20+
['Devnet']: '',
21+
};
1822

1923
export function parseMessageId(id: string): {
2024
chain: number;
@@ -89,7 +93,7 @@ export async function formatAndSendToSlack(info: SlackInfo): Promise<any> {
8993

9094
export async function isVAASigned(network: Network, vaaKey: string): Promise<boolean> {
9195
const url: string =
92-
WormholescanRPC + 'v1/signed_vaa/' + vaaKey + '?network=' + network.toUpperCase();
96+
WormholescanRPC[network] + 'v1/signed_vaa/' + vaaKey + '?network=' + network.toUpperCase();
9397
try {
9498
const response = await axios.get(url);
9599
// curl -X 'GET' \

0 commit comments

Comments
 (0)