Remove dead eligibleShare computation from Account#62
Merged
Conversation
Matchstick writes a timestamp to this file on every test run, which creates spurious diffs. Move it to .gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
eligibleShare and eligibleShareSnapshot were computed and stored on every Account but never read by any downstream consumer: - cyclo.rewards computes eligibility locally from raw events - cyclo.site only queries totalCyBalance/totalCyBalanceSnapshot Remove the field from the schema, drop calculateEligibleShare() and the per-account loop in takeSnapshot that sets eligibleShareSnapshot. Consumers can compute share locally from totalCyBalance and totalEligibleSum if ever needed. Closes #61 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
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
Account.eligibleShareandAccount.eligibleShareSnapshotfrom schema + mappings — they were computed on every transfer and snapshot but never read by any consumertests/.latest.json(matchstick writes a timestamp on every test run, causing spurious diffs)Why
Checked usage across the org:
totalCyBalance/totalCyBalanceSnapshot(grep-confirmed in.graphqlfiles;eligibleShareonly appears in auto-generated type defs)So the BigDecimal division in
calculateEligibleShare(and the per-account loop intakeSnapshotsettingeligibleShareSnapshot) run on every event for a value nothing downstream reads. Removing saves storage + write cost.If share is ever needed, consumers can compute
totalCyBalance / totalEligibleSumlocally.Closes #61. Supersedes the stale #3.
Test plan
graph codegenpassesgraph buildpasses🤖 Generated with Claude Code