Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: minor fixes #2166

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 !==
Expand Down Expand Up @@ -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()
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,19 @@ export const ProposalRow = ({
// set proposal time
if (!time) {
connection
.getConfirmedSignaturesForAddress2(proposal.publicKey)
.getSignaturesForAddress(proposal.publicKey)
.then((txs) => {
if (isCancelled) return
const firstBlockTime = txs?.[txs.length - 1]?.blockTime
if (firstBlockTime) {
setTime(new Date(firstBlockTime * 1000))
}
})
.catch((err) => {
console.error(
`Error fetching proposal time for ${proposal.publicKey.toBase58()}: ${err}`
)
})
}

// calculate instructions summary
Expand Down
Loading