Skip to content

Commit c8765e3

Browse files
committed
fix: address feedback
1 parent f14ef56 commit c8765e3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

governance/xc_admin/packages/xc_admin_common/src/price_store.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,11 @@ export async function isPriceStorePublisherInitialized(
331331
const response = await connection.getAccountInfo(publisherConfigKey);
332332
return response !== null;
333333
}
334+
335+
export async function isPriceStoreInitialized(
336+
connection: Connection
337+
): Promise<boolean> {
338+
const configKey = findPriceStoreConfigAddress()[0];
339+
const response = await connection.getAccountInfo(configKey);
340+
return response !== null;
341+
}

governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
PRICE_FEED_OPS_KEY,
2222
getMessageBufferAddressForPrice,
2323
getMaximumNumberOfPublishers,
24+
isPriceStoreInitialized,
2425
isPriceStorePublisherInitialized,
2526
createDetermisticPriceStoreInitializePublisherInstruction,
2627
} from '@pythnetwork/xc-admin-common'
@@ -302,8 +303,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
302303
: multisigAuthority
303304

304305
const initPublisherInPriceStore = async (publisherKey: PublicKey) => {
305-
// Price store is only available in Pythnet and Pythtest-crosschain
306-
if (cluster !== 'pythnet' && cluster !== 'pythtest-crosschain') {
306+
// Ignore this step if Price Store is not initialized (or not deployed)
307+
if (!connection || !(await isPriceStoreInitialized(connection))) {
307308
return
308309
}
309310

0 commit comments

Comments
 (0)