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() {
66
66
: - 1 ;
67
67
lastSequenceNumber = Math . max ( lastSequenceNumber , OFFSET ) ;
68
68
const wormholeApi = WORMHOLE_API_ENDPOINT [ CLUSTER ] ;
69
-
69
+ const productAccountToSymbol : { [ key : string ] : string } = { } ;
70
70
while ( true ) {
71
71
lastSequenceNumber += 1 ;
72
72
console . log ( `Trying sequence number : ${ lastSequenceNumber } ` ) ;
@@ -129,20 +129,28 @@ async function run() {
129
129
AccountType . Product
130
130
)
131
131
) ;
132
+ productAccountToSymbol [
133
+ parsedInstruction . accounts . named . productAccount . pubkey . toBase58 ( )
134
+ ] = parsedInstruction . args . symbol ;
132
135
} else if (
133
136
parsedInstruction instanceof PythMultisigInstruction &&
134
137
parsedInstruction . name == "addPrice"
135
138
) {
136
139
const productAccount = await provider . connection . getAccountInfo (
137
140
parsedInstruction . accounts . named . productAccount . pubkey
138
141
) ;
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 ) {
140
148
preInstructions . push (
141
149
await getCreateAccountWithSeedInstruction (
142
150
provider . connection ,
143
151
CLUSTER ,
144
152
provider . wallet . publicKey ,
145
- parseProductData ( productAccount . data ) . product . symbol ,
153
+ productSymbol ,
146
154
AccountType . Price
147
155
)
148
156
) ;
You can’t perform that action at this time.
0 commit comments