Skip to content

Conversation

@wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Sep 30, 2025

In continuation of #593

This PR will set the proposal's scores_total_value with an async script

It's using a simple local computation, to get the total value, from existing data, only on closed proposals, and with final scores_state.

wa0x6e added 30 commits August 4, 2025 00:20
fix: fix botched merge conflict

chore: remove typo

fix: fix typescript error

fix: fix lint error

fix: delete unused file
test: fix tests
it should be done async, via a separate infinite loop script
@wa0x6e wa0x6e force-pushed the feat-set-proposal-scores-value branch from 176da36 to 0d900d3 Compare September 30, 2025 23:29
@wa0x6e wa0x6e requested a review from Copilot September 30, 2025 23:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +61 to +71
while (true) {
const proposals = await getProposals();

if (proposals.length === 0) break;

if (proposals.length) {
await refreshVpByStrategy(proposals);
}

if (proposals.length < BATCH_SIZE) {
await snapshot.utils.sleep(REFRESH_INTERVAL);
if (proposals.length < BATCH_SIZE) break;
}

await snapshot.utils.sleep(REFRESH_INTERVAL);
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Nested infinite loops create unreachable code. The outer while loop will never continue after the inner loop breaks, making it effectively dead code.

Copilot uses AI. Check for mistakes.
expect.assertions(3);
mockGetSpace.mockResolvedValueOnce({
...spacesGetSpaceFixtures,
network: '56', // Using Ethereum mainnet, which is in the premium list
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Comment incorrectly states network '56' is Ethereum mainnet, but '56' is actually BSC (Binance Smart Chain) network ID. Ethereum mainnet is network '1'.

Suggested change
network: '56', // Using Ethereum mainnet, which is in the premium list
network: '56', // Using BSC (Binance Smart Chain), which is in the premium list

Copilot uses AI. Check for mistakes.
@wa0x6e wa0x6e requested a review from bonustrack September 30, 2025 23:41
query.push('UPDATE proposals SET scores_total_value = ?, cb = ? WHERE id = ? LIMIT 1');

try {
const scores_total_value = getProposalValue(
Copy link
Member

@bonustrack bonustrack Oct 1, 2025

Choose a reason for hiding this comment

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

We should never use snake case for root const name

@wa0x6e wa0x6e changed the base branch from feat-set-vote-vp-value to master October 1, 2025 12:32
@wa0x6e
Copy link
Contributor Author

wa0x6e commented Oct 1, 2025

Closing in favor of #595

@wa0x6e wa0x6e closed this Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants