Skip to content

Conversation

@Doryu001
Copy link

@Doryu001 Doryu001 commented Nov 5, 2025

Remove the unnecessary return await in GovernorNoncesKeyed.test.js preserve the async helper’s behavior while avoiding the superfluous await pattern

@Doryu001 Doryu001 requested a review from a team as a code owner November 5, 2025 19:19
@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: 509b91d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

The getNonce helper function in the governance test file was refactored to return promises directly from both branches of a ternary operator. The change removes an unnecessary await expression and extra parentheses, streamlining the code structure. No alterations were made to exported or public entity declarations. The refactoring is purely stylistic with equivalent functionality and control flow.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing a redundant await in the GovernorNoncesKeyed helper function.
Description check ✅ Passed The description is related to the changeset, explaining the removal of unnecessary 'return await' while preserving async behavior.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed6a47e and afd0735.

📒 Files selected for processing (1)
  • test/governance/extensions/GovernorNoncesKeyed.test.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: slither
  • GitHub Check: tests
  • GitHub Check: halmos
  • GitHub Check: coverage
  • GitHub Check: tests-foundry
  • GitHub Check: tests-upgradeable
🔇 Additional comments (1)
test/governance/extensions/GovernorNoncesKeyed.test.js (1)

94-98: LGTM! Good refactoring.

Removing the redundant await is correct since the function simply returns the promise without additional processing. Both branches of the ternary consistently return promises that are properly awaited by all callers.


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.

ernestognw
ernestognw previously approved these changes Nov 5, 2025
@Amxx Amxx changed the base branch from master to typo-fixes November 10, 2025 10:13
@Amxx Amxx merged commit c906400 into OpenZeppelin:typo-fixes Nov 10, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants