File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
governance/xc_admin/packages/crank_pythnet_relayer/src Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ async function run() {
6666 : - 1 ;
6767 lastSequenceNumber = Math . max ( lastSequenceNumber , OFFSET ) ;
6868 const wormholeApi = WORMHOLE_API_ENDPOINT [ CLUSTER ] ;
69-
69+ const productAccountToSymbol : { [ key : string ] : string } = { } ;
7070 while ( true ) {
7171 lastSequenceNumber += 1 ;
7272 console . log ( `Trying sequence number : ${ lastSequenceNumber } ` ) ;
@@ -129,20 +129,28 @@ async function run() {
129129 AccountType . Product
130130 )
131131 ) ;
132+ productAccountToSymbol [
133+ parsedInstruction . accounts . named . productAccount . pubkey . toBase58 ( )
134+ ] = parsedInstruction . args . symbol ;
132135 } else if (
133136 parsedInstruction instanceof PythMultisigInstruction &&
134137 parsedInstruction . name == "addPrice"
135138 ) {
136139 const productAccount = await provider . connection . getAccountInfo (
137140 parsedInstruction . accounts . named . productAccount . pubkey
138141 ) ;
139- if ( productAccount ) {
142+ const productSymbol = productAccount
143+ ? parseProductData ( productAccount . data ) . product . symbol
144+ : productAccountToSymbol [
145+ parsedInstruction . accounts . named . productAccount . pubkey . toBase58 ( )
146+ ] ;
147+ if ( productSymbol ) {
140148 preInstructions . push (
141149 await getCreateAccountWithSeedInstruction (
142150 provider . connection ,
143151 CLUSTER ,
144152 provider . wallet . publicKey ,
145- parseProductData ( productAccount . data ) . product . symbol ,
153+ productSymbol ,
146154 AccountType . Price
147155 )
148156 ) ;
You can’t perform that action at this time.
0 commit comments