Skip to content

Make Votes.sol _validateTimepoint virtual#6400

Open
gonzaotc wants to merge 1 commit intoOpenZeppelin:masterfrom
gonzaotc:feat/votes-validateTimepoint-virtual
Open

Make Votes.sol _validateTimepoint virtual#6400
gonzaotc wants to merge 1 commit intoOpenZeppelin:masterfrom
gonzaotc:feat/votes-validateTimepoint-virtual

Conversation

@gonzaotc
Copy link
Contributor

Makes Votes.sol _validateTimepoint virtual, neccesary when combining ERC20Votes with other contracts that implement _validateTimepoint

@gonzaotc gonzaotc requested a review from a team as a code owner March 10, 2026 01:52
@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: 4a8adc9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Walkthrough

This pull request adds a changeset for a patch release of openzeppelin-solidity and modifies the governance utilities. The _validateTimepoint function in Votes.sol is updated to be declared as virtual, allowing derived contracts the capability to override this internal function. The change adds the virtual modifier to the function signature while maintaining all other aspects of the function unchanged.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding the virtual modifier to the _validateTimepoint function in Votes.sol.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose and rationale for making _validateTimepoint virtual in Votes.sol.
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
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
contracts/governance/utils/Votes.sol (1)

78-81: Add a regression test for the new override hook.

This change fixes a source-level inheritance issue, but the PR should also prove it with a test: a derived contract that overrides _validateTimepoint across multiple bases and verifies that the past-lookup entry points still route through that override. Without that, this compatibility fix can regress silently.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a67b7c1e-fb5d-4f18-9950-80eba57dcb62

📥 Commits

Reviewing files that changed from the base of the PR and between 45f032d and 4a8adc9.

📒 Files selected for processing (2)
  • .changeset/wicked-dingos-wish.md
  • contracts/governance/utils/Votes.sol

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.

1 participant