Skip to content

name change - #660

Merged
ozgunozerk merged 4 commits into
mainfrom
n-03
Mar 25, 2026
Merged

ozgunozerk merged 4 commits into
mainfrom
n-03

Conversation

@ozgunozerk

@ozgunozerk ozgunozerk commented Mar 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #642

PR Checklist

  • Tests
  • Documentation

Summary by CodeRabbit

  • Refactor
    • Updated governance proposal event structures and internal ledger storage by standardizing snapshot-based voting phase terminology throughout the voting framework. These refinements improve code consistency and documentation clarity while preserving all voting mechanics, proposal lifecycle behavior, and external functionality.

@ozgunozerk
ozgunozerk requested a review from brozorec March 25, 2026 07:42
@ozgunozerk ozgunozerk self-assigned this Mar 25, 2026
@coderabbitai

coderabbitai Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1943f2a-9843-46a7-827a-1a8a5758a6eb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The PR renames the vote_start field to vote_snapshot across the governance module to align with snapshot-based voting semantics. Changes span the ProposalCreated event definition, the ProposalCore struct, related query helpers, proposal state derivation, and inline test documentation.

Changes

Cohort / File(s) Summary
Test Documentation
examples/fungible-governor/token/src/test.rs
Updated inline test comments to consistently refer to vote_snapshot instead of vote_start in governance lifecycle and voting-power snapshot assertions; no logic changes.
Event Definition
packages/governance/src/governor/mod.rs
Renamed ProposalCreated event field vote_start to vote_snapshot; updated emit_proposal_created function signature and docstrings to reflect snapshot-based voting semantics.
Storage & State Logic
packages/governance/src/governor/storage.rs
Renamed ProposalCore.vote_start field to vote_snapshot; updated get_proposal_snapshot and check_proposal_state to return vote_snapshot; modified proposal creation and state-derivation logic to compute and compare against vote_snapshot.
Test Helpers
packages/governance/src/governor/test.rs
Updated store_proposal_with_quorum test helper to construct ProposalCore with vote_snapshot field; adjusted test comment to reference snapshot-based voting schedule.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Governance base contract #563: Directly relates to the same field renaming in ProposalCreated event, emit_proposal_created signature, and ProposalCore struct initialization.

Suggested labels

Small

Suggested reviewers

  • brozorec

Poem

🐰 A snapshot's born, no longer just a start,
Vote times renamed with voting-magic art,
Through structs and storage hops our whiskers twitch,
Each vote_start now vote_snapshot—exactly which!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'name change' is too vague and generic, failing to clearly convey what specific names were changed or why. Use a more descriptive title that specifies the renamed field, such as 'Rename vote_start to vote_snapshot in governance proposal structure'.
Linked Issues check ❓ Inconclusive The linked issue title indicates a naming suggestion but lacks detailed requirements, making it difficult to verify whether all coding changes fully address the issue's scope.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description appropriately references the linked issue (#642) and confirms that tests and documentation were updated, meeting the template requirements.
Out of Scope Changes check ✅ Passed All changes consistently rename vote_start to vote_snapshot across test files, storage definitions, events, and helper functions, with no unrelated modifications detected.
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
  • Commit unit tests in branch n-03

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/fungible-governor/token/src/test.rs`:
- Around line 455-460: The comment and code formatting around the post-snapshot
mint is out of rustfmt style; run rustfmt (cargo +nightly fmt --all) or apply
the formatter to test.rs so the comment block and the s.token.mint(&voter,
&10000); line are reformatted to match project style; ensure the inline comments
remain but spacing/indentation around the mint call and the two comment lines is
adjusted by the formatter so CI passes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aae48b0d-9d94-4211-a522-13d2e1371564

📥 Commits

Reviewing files that changed from the base of the PR and between ff17d24 and 88b1cf6.

📒 Files selected for processing (4)
  • examples/fungible-governor/token/src/test.rs
  • packages/governance/src/governor/mod.rs
  • packages/governance/src/governor/storage.rs
  • packages/governance/src/governor/test.rs

@codecov

codecov Bot commented Mar 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.17%. Comparing base (c1f1686) to head (5a937f5).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #660   +/-   ##
=======================================
  Coverage   96.17%   96.17%           
=======================================
  Files          59       59           
  Lines        6150     6150           
=======================================
  Hits         5915     5915           
  Misses        235      235           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ozgunozerk
ozgunozerk merged commit 39a6b93 into main Mar 25, 2026
6 checks passed
@ozgunozerk
ozgunozerk deleted the n-03 branch March 25, 2026 15:02
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.

[N-03] - Naming Suggestion

2 participants