Skip to content

Commit

Permalink
fix: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati committed Nov 27, 2024
1 parent f14ef56 commit 947c2cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,11 @@ export async function isPriceStorePublisherInitialized(
const response = await connection.getAccountInfo(publisherConfigKey);
return response !== null;
}

export async function isPriceStoreInitialized(
connection: Connection
): Promise<boolean> {
const configKey = findPriceStoreConfigAddress()[0];
const response = await connection.getAccountInfo(configKey);
return response !== null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
PRICE_FEED_OPS_KEY,
getMessageBufferAddressForPrice,
getMaximumNumberOfPublishers,
isPriceStoreInitialized,
isPriceStorePublisherInitialized,
createDetermisticPriceStoreInitializePublisherInstruction,
} from '@pythnetwork/xc-admin-common'
Expand Down Expand Up @@ -302,8 +303,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
: multisigAuthority

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

Expand Down

0 comments on commit 947c2cf

Please sign in to comment.