@@ -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'
@@ -290,7 +291,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
290291 const handleSendProposalButtonClick = async ( ) => {
291292 if ( pythProgramClient && dataChanges && ! isMultisigLoading && squads ) {
292293 const instructions : TransactionInstruction [ ] = [ ]
293- const publisherInitializationsVerified : PublicKey [ ] = [ ]
294+ const publisherInPriceStoreInitializationsVerified : PublicKey [ ] = [ ]
294295
295296 for ( const symbol of Object . keys ( dataChanges ) ) {
296297 const multisigAuthority = squads . getAuthorityPDA (
@@ -301,9 +302,14 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
301302 ? mapKey ( multisigAuthority )
302303 : multisigAuthority
303304
304- const initPublisher = async ( publisherKey : PublicKey ) => {
305+ const initPublisherInPriceStore = async ( publisherKey : PublicKey ) => {
306+ // Ignore this step if Price Store is not initialized (or not deployed)
307+ if ( ! connection || ! ( await isPriceStoreInitialized ( connection ) ) ) {
308+ return
309+ }
310+
305311 if (
306- publisherInitializationsVerified . every (
312+ publisherInPriceStoreInitializationsVerified . every (
307313 ( el ) => ! el . equals ( publisherKey )
308314 )
309315 ) {
@@ -321,7 +327,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
321327 )
322328 )
323329 }
324- publisherInitializationsVerified . push ( publisherKey )
330+ publisherInPriceStoreInitializationsVerified . push ( publisherKey )
325331 }
326332 }
327333 const { prev, new : newChanges } = dataChanges [ symbol ]
@@ -406,7 +412,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
406412 } )
407413 . instruction ( )
408414 )
409- await initPublisher ( publisherPubKey )
415+ await initPublisherInPriceStore ( publisherPubKey )
410416 }
411417
412418 // create set min publisher instruction if there are any publishers
@@ -576,7 +582,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
576582 } )
577583 . instruction ( )
578584 )
579- await initPublisher ( publisherPubKey )
585+ await initPublisherInPriceStore ( publisherPubKey )
580586 }
581587 }
582588 }
0 commit comments