Skip to content

Commit 3842c94

Browse files
authored
Enable exponent update (#750)
1 parent 4502c6d commit 3842c94

File tree

1 file changed

+17
-0
lines changed
  • governance/xc_admin/packages/xc_admin_frontend/components/tabs

1 file changed

+17
-0
lines changed

governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,23 @@ const General = () => {
391391
.instruction()
392392
)
393393
}
394+
395+
if (
396+
JSON.stringify(prev.priceAccounts[0].expo) !==
397+
JSON.stringify(newChanges.priceAccounts[0].expo)
398+
) {
399+
// create update exponent instruction
400+
instructions.push(
401+
await pythProgramClient.methods
402+
.initPrice(newChanges.priceAccounts[0].expo, 1)
403+
.accounts({
404+
fundingAccount,
405+
priceAccount: new PublicKey(prev.priceAccounts[0].address),
406+
})
407+
.instruction()
408+
)
409+
}
410+
394411
// check if minPub has changed
395412
if (
396413
prev.priceAccounts[0].minPub !== newChanges.priceAccounts[0].minPub

0 commit comments

Comments
 (0)