File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
governance/xc_admin/packages
xc_admin_frontend/components/tabs Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments