From c6a78a605508109c1691e0335f21d543316fe0d7 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Wed, 4 Dec 2024 14:44:28 +0000 Subject: [PATCH] use getSignaturesForAddress --- .../components/tabs/General.tsx | 32 +++++++++---------- .../components/tabs/Proposals/ProposalRow.tsx | 16 ++++------ 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx b/governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx index aa587b0be..7451fcae0 100644 --- a/governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx +++ b/governance/xc_admin/packages/xc_admin_frontend/components/tabs/General.tsx @@ -508,22 +508,6 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => { ) } - // check if minPub has changed - if ( - prev.priceAccounts[0].minPub !== newChanges.priceAccounts[0].minPub - ) { - // create update product account instruction - instructions.push( - await pythProgramClient.methods - .setMinPub(newChanges.priceAccounts[0].minPub, [0, 0, 0]) - .accounts({ - priceAccount: new PublicKey(prev.priceAccounts[0].address), - fundingAccount, - }) - .instruction() - ) - } - // check if maxLatency has changed if ( prev.priceAccounts[0].maxLatency !== @@ -584,6 +568,22 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => { ) await initPublisherInPriceStore(publisherPubKey) } + + // check if minPub has changed + if ( + prev.priceAccounts[0].minPub !== newChanges.priceAccounts[0].minPub + ) { + // create update product account instruction + instructions.push( + await pythProgramClient.methods + .setMinPub(newChanges.priceAccounts[0].minPub, [0, 0, 0]) + .accounts({ + priceAccount: new PublicKey(prev.priceAccounts[0].address), + fundingAccount, + }) + .instruction() + ) + } } } diff --git a/governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/ProposalRow.tsx b/governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/ProposalRow.tsx index 1b0635ffa..eac37b0c9 100644 --- a/governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/ProposalRow.tsx +++ b/governance/xc_admin/packages/xc_admin_frontend/components/tabs/Proposals/ProposalRow.tsx @@ -55,15 +55,13 @@ export const ProposalRow = ({ // set proposal time if (!time) { - connection - .getConfirmedSignaturesForAddress2(proposal.publicKey) - .then((txs) => { - if (isCancelled) return - const firstBlockTime = txs?.[txs.length - 1]?.blockTime - if (firstBlockTime) { - setTime(new Date(firstBlockTime * 1000)) - } - }) + connection.getSignaturesForAddress(proposal.publicKey).then((txs) => { + if (isCancelled) return + const firstBlockTime = txs?.[txs.length - 1]?.blockTime + if (firstBlockTime) { + setTime(new Date(firstBlockTime * 1000)) + } + }) } // calculate instructions summary