-
Notifications
You must be signed in to change notification settings - Fork 13
feat(overlord): add async script to set proposal scores value #594
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
Conversation
chore: fix types
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
Co-authored-by: Less <bonustrack@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
176da36 to
0d900d3
Compare
There was a problem hiding this 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.
| 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); |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
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.
| expect.assertions(3); | ||
| mockGetSpace.mockResolvedValueOnce({ | ||
| ...spacesGetSpaceFixtures, | ||
| network: '56', // Using Ethereum mainnet, which is in the premium list |
Copilot
AI
Sep 30, 2025
There was a problem hiding this comment.
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'.
| network: '56', // Using Ethereum mainnet, which is in the premium list | |
| network: '56', // Using BSC (Binance Smart Chain), which is in the premium list |
src/helpers/proposalsScoresValue.ts
Outdated
| query.push('UPDATE proposals SET scores_total_value = ?, cb = ? WHERE id = ? LIMIT 1'); | ||
|
|
||
| try { | ||
| const scores_total_value = getProposalValue( |
There was a problem hiding this comment.
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
|
Closing in favor of #595 |
In continuation of #593
This PR will set the proposal's
scores_total_valuewith an async scriptIt's using a simple local computation, to get the total value, from existing data, only on closed proposals, and with final scores_state.