Add CI checks for formatting, solhint, and tests#178
Merged
Conversation
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
mainClaim.getAllocationInfotest so the new test job passes reliablyCI Changes
.github/workflows/ci.ymlto run on pushes tomainand pull requests targetingmainnpm ci,npm run format:check,npm run solhint:check, andnpx hardhat testformat:checkusingprettier --checksolhint:checkusingsolhint --max-warnings 0Ignore / Scope Adjustments
contracts/verifiers/PlonkVerifier.solout of format checks because it is generated.claude/anddocs/index.mdout of Prettier checks to avoid CI noise from local/generated filesformatandsolhint:fixfor write-mode usageIncluded Fix From #177
The branch also includes the
Claim.getAllocationInfotest fix from #177 so the new CI test job is green on this PR.Background
The failing claim test was asserting a fixed
allocationPerPeriodvalue for period0.ClaiminitializesstartTimestampfrom the current block timestamp, andAllocationLibcomputes rewards from the elapsed days sinceGENESIS_TIMESTAMP. Because the reward schedule halves across phases, the expected allocation changes over time.That made the test date-dependent: it passed when the fixed value matched the active reward phase, then started failing once the schedule moved to the next phase. The contract logic itself remained consistent with the allocation schedule.
Test Fix
getAllocationConstants()instead of comparing against a stale literalClaimorAllocationLibCloses #175
Closes #174
Testing
npm run format:checknpm run solhint:checknpm test