Skip to content

test: expand GovernorStorage coverage#6556

Open
knoal wants to merge 1 commit into
OpenZeppelin:masterfrom
knoal:test/governor-storage-coverage-5550
Open

test: expand GovernorStorage coverage#6556
knoal wants to merge 1 commit into
OpenZeppelin:masterfrom
knoal:test/governor-storage-coverage-5550

Conversation

@knoal

@knoal knoal commented May 28, 2026

Copy link
Copy Markdown

Summary

  • add coverage for multiple GovernorStorage proposals being tracked in creation order
  • assert out-of-bounds access still reverts after multiple proposals exist
  • verify stored proposal details remain accessible after cancellation

Testing

  • ./node_modules/.bin/hardhat test test/governance/extensions/GovernorStorage.test.js
  • ./node_modules/.bin/prettier --check test/governance/extensions/GovernorStorage.test.js
  • ./node_modules/.bin/eslint test/governance/extensions/GovernorStorage.test.js

Closes #5550

@knoal knoal requested a review from a team as a code owner May 28, 2026 13:11
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5b71a489-d547-4f13-b94c-8ee4384456a8

📥 Commits

Reviewing files that changed from the base of the PR and between 74edc4b and 7320e31.

📒 Files selected for processing (2)
  • .changeset/green-apples-joke.md
  • test/governance/extensions/GovernorStorage.test.js

Walkthrough

This PR adds two new test cases to the GovernorStorage test suite to improve test coverage around proposal indexing. The first test case verifies that proposalCount and proposalDetailsAt correctly reflect multiple proposals in their creation order, including reverting on out-of-bounds access. The second test case confirms that proposalDetails and proposalDetailsAt(0) remain accessible after a proposal is cancelled. A Changesets entry documents these test coverage improvements.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: expanding test coverage for the GovernorStorage component.
Description check ✅ Passed The description clearly outlines the specific test additions and improvements related to GovernorStorage coverage and includes relevant testing commands.
Linked Issues check ✅ Passed The PR addresses issue #5550's requirement to add edge-case coverage for multiple proposals and verify behavior after cancellation, though documentation/code clarity improvements are not fully addressed.
Out of Scope Changes check ✅ Passed All changes are focused on test coverage expansion for GovernorStorage as specified in the linked issue, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Improve GovernorStorage Test Coverage and Documentation

1 participant