Fix gasless poll vote dedupe and exclude staking-engine delegation from totals#73
Open
adamgoth wants to merge 4 commits intofeature/subgraphs-migrationfrom
Open
Fix gasless poll vote dedupe and exclude staking-engine delegation from totals#73adamgoth wants to merge 4 commits intofeature/subgraphs-migrationfrom
adamgoth wants to merge 4 commits intofeature/subgraphs-migrationfrom
Conversation
- Updated `fetchDelegationMetrics` to paginate through delegations and calculate total delegated amounts and delegator counts. - Introduced new GraphQL query `allDelegationsPaginated` to fetch delegations while excluding staking engine addresses. - Added unit tests for `fetchDelegationMetrics` to ensure correct pagination and calculations. - Refactored `fetchDelegatesPaginated` to use the new total delegated calculation and delegator count logic.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Updated VoterData and VoterWithWeight interfaces to make the address property optional. - Introduced a helper function to retrieve voter addresses, accommodating cases where the address may not be directly available. - Adjusted mapping functions to utilize the new address retrieval logic, ensuring consistent handling of voter addresses across different chains.
- Updated GraphQL queries in `allArbitrumVoters`, `allMainnetVoters`, and `voteAddressSkyWeightsAtTime` to use named queries for improved clarity. - Enhanced `fetchVotesByAddressForPoll` to handle potential undefined values for poll start and end dates, ensuring robust data handling. - Adjusted vote retrieval logic to default to empty arrays when no votes are found, improving resilience against missing data.
- Modified `fetchDelegationMetrics` to aggregate total delegated amounts and delegator counts, accounting for staking engine delegations. - Updated GraphQL queries to fetch delegates and staking engine delegations, enhancing data retrieval efficiency. - Adjusted unit tests to reflect changes in metrics calculation and ensure accurate results.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes three correctness regressions introduced by the Envio aggregate migration:
Changes
skyDelegateddelegatorCountcan subtract the special row without relying on the truncated delegations relation length