Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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))
}
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a catch, even if it's just to log -- generally you should include a catch any time you use a promise without async/await, otherwise uncaught async errors can put the application in a bad state but be very hard to debug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

// calculate instructions summary
Expand Down
Loading