Skip to content

chore: fix comment formatting and typos across codebase#4581

Open
criciss wants to merge 1 commit intozeta-chain:mainfrom
criciss:main
Open

chore: fix comment formatting and typos across codebase#4581
criciss wants to merge 1 commit intozeta-chain:mainfrom
criciss:main

Conversation

@criciss
Copy link
Copy Markdown

@criciss criciss commented May 3, 2026

Description

fix comment formatting and typos across codebase

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Greptile Summary

This PR makes comment-only fixes across three files — correcting duplicate words, extra spaces before commas, "ZRC4" → "ZRC20" label references, and minor grammar. No functional code is changed.

  • The VoteOutbound doc comment in msg_server_vote_outbound.go now reads as an incomplete sentence (missing verb) after is minted was removed.
  • BalanceOfZRC4 and TotalSupplyZRC4 in evm.go have their godoc lines updated to reference ZRC20 while the function names still say ZRC4, violating Go's naming convention for doc comments.
  • A pre-existing \"into to account\" typo in DepositZRC20's comment was not fixed despite a similar fix being made in DepositZeta.

Confidence Score: 4/5

Safe to merge — comment-only changes with no functional impact, minor remaining comment quality issues.

All changes are cosmetic (comments only), so there is zero risk of runtime regression. The score is held to 4 rather than 5 due to three P2 comment-quality issues introduced or missed by this PR: an incomplete sentence, a godoc name mismatch, and an unfixed typo.

x/fungible/keeper/evm.go (godoc name mismatch for BalanceOfZRC4/TotalSupplyZRC4, missed "into to" typo) and x/crosschain/keeper/msg_server_vote_outbound.go (incomplete sentence)

Important Files Changed

Filename Overview
x/crosschain/keeper/gas_payment.go Single comment fix: removed duplicate "chain" word and extra space before comma — clean and correct.
x/crosschain/keeper/msg_server_vote_outbound.go Two comment fixes: punctuation/spacing improvements in refundUnusedGas are good, but the VoteOutbound doc comment now has a missing verb after removing "is minted".
x/fungible/keeper/evm.go Several comment fixes are good, but BalanceOfZRC4 and TotalSupplyZRC4 godoc names were changed to "ZRC20" while the function names remain "ZRC4", and a "into to" typo in DepositZRC20 was missed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[PR: Fix comment formatting & typos] --> B[gas_payment.go]
    A --> C[msg_server_vote_outbound.go]
    A --> D[evm.go]

    B --> B1["✅ 'chain chain id ,' → 'chain id,'"]

    C --> C1["✅ Punctuation fixes in refundUnusedGas"]
    C --> C2["⚠️ VoteOutbound doc: removed 'is minted' → incomplete sentence"]

    D --> D1["✅ 'ZRC4' → 'ZRC20' in DepositZRC20 comment"]
    D --> D2["✅ 'and account' → 'an account' in DepositZeta"]
    D --> D3["✅ Trailing space before comma fixes"]
    D --> D4["✅ 'Marshall' → 'Marshal'"]
    D --> D5["⚠️ BalanceOfZRC4/TotalSupplyZRC4 godoc names now say 'ZRC20'"]
    D --> D6["⚠️ 'into to account' typo still present in DepositZRC20"]
Loading
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
x/crosschain/keeper/msg_server_vote_outbound.go:28-30
**Incomplete sentence after removing "is minted"**

The edit removed `is minted` to avoid the awkward repetition, but the resulting sentence now lacks a main verb — "the difference between zeta burned and minted by the bank module and deposited into the module account" is a noun phrase with no predicate. Consider restoring the verb with a cleaner rewrite.

```suggestion
// If the observation is successful, the difference between zeta burned
// and minted is deposited into the module
// account by the bank module.
```

### Issue 2 of 3
x/fungible/keeper/evm.go:622-623
**Godoc comment name doesn't match function name**

Go's convention is that a doc comment must begin with the exact name of the symbol it documents so that `go doc` and IDEs can associate it correctly. Changing the comment to `BalanceOfZRC20` while the function is still named `BalanceOfZRC4` creates a mismatch — the same issue exists one function below for `TotalSupplyZRC4` (comment now reads `TotalSupplyZRC20`). Either revert the comment names to match the functions, or rename the functions themselves.

```suggestion
// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
```

### Issue 3 of 3
x/fungible/keeper/evm.go:245
**Missed typo: "into to" should be "into an"**

The PR fixed a similar "and" → "an" typo in `DepositZeta` but left `DepositZRC20` with the same malformed phrase.

```suggestion
// DepositZRC20 deposits ZRC20 tokens into an account;
```

Reviews (1): Last reviewed commit: "chore: fix comment formatting and typos ..." | Re-trigger Greptile

Greptile also left 3 inline comments on this PR.

Summary by CodeRabbit

  • Documentation

    • Improved inline code documentation across keeper modules for clarity and consistency.
  • Chores

    • Minor formatting refinements in error handling paths.

Note: This release contains internal code improvements with no user-facing changes or new functionality.

@criciss criciss requested a review from a team as a code owner May 3, 2026 08:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8256c25b-cf6e-4fe8-978f-579dafaad053

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

Walkthrough

Documentation updates clarify chainID semantics in gas payment logic, reword early-return conditions in vote outbound, update terminology from ZRC4 to ZRC20 in fungible keeper, and adjust spacing in error message formatting. No executable logic changed.

Changes

Documentation and Error Message Formatting

Layer / File(s) Summary
Comment Clarifications
x/crosschain/keeper/gas_payment.go, x/crosschain/keeper/msg_server_vote_outbound.go, x/fungible/keeper/evm.go
Clarified chainID semantics for outbound transactions in PayGasAndUpdateCctx, reworded early-return conditions in refundUnusedGas, and updated ZRC4 references to ZRC20 in doc comments for DepositZRC20, BalanceOfZRC20, and TotalSupplyZRC20.
Error Message Formatting
x/fungible/keeper/evm.go
Adjusted spacing in JSON-marshalling error formatting within CallEVM (added space after comma) while preserving all control flow and error handling behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request description addresses the core purpose (fixing comment formatting and typos) but lacks substantive detail about the scope and impact of changes. Expand the description to enumerate affected files, clarify the nature of fixes (formatting vs. typo corrections), and provide rationale for why these changes improve code quality or maintainability.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the changes as comment formatting and typo fixes, which aligns with the file-level summaries showing only documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Comment on lines 28 to 30
// If the observation is successful, the difference between zeta burned
// and minted is minted by the bank module and deposited into the module
// and minted by the bank module and deposited into the module
// account.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Incomplete sentence after removing "is minted"

The edit removed is minted to avoid the awkward repetition, but the resulting sentence now lacks a main verb — "the difference between zeta burned and minted by the bank module and deposited into the module account" is a noun phrase with no predicate. Consider restoring the verb with a cleaner rewrite.

Suggested change
// If the observation is successful, the difference between zeta burned
// and minted is minted by the bank module and deposited into the module
// and minted by the bank module and deposited into the module
// account.
// If the observation is successful, the difference between zeta burned
// and minted is deposited into the module
// account by the bank module.
Prompt To Fix With AI
This is a comment left during a code review.
Path: x/crosschain/keeper/msg_server_vote_outbound.go
Line: 28-30

Comment:
**Incomplete sentence after removing "is minted"**

The edit removed `is minted` to avoid the awkward repetition, but the resulting sentence now lacks a main verb — "the difference between zeta burned and minted by the bank module and deposited into the module account" is a noun phrase with no predicate. Consider restoring the verb with a cleaner rewrite.

```suggestion
// If the observation is successful, the difference between zeta burned
// and minted is deposited into the module
// account by the bank module.
```

How can I resolve this? If you propose a fix, please make it concise.

Comment thread x/fungible/keeper/evm.go Outdated
Comment on lines 622 to 623
// BalanceOfZRC20 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Godoc comment name doesn't match function name

Go's convention is that a doc comment must begin with the exact name of the symbol it documents so that go doc and IDEs can associate it correctly. Changing the comment to BalanceOfZRC20 while the function is still named BalanceOfZRC4 creates a mismatch — the same issue exists one function below for TotalSupplyZRC4 (comment now reads TotalSupplyZRC20). Either revert the comment names to match the functions, or rename the functions themselves.

Suggested change
// BalanceOfZRC20 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
Prompt To Fix With AI
This is a comment left during a code review.
Path: x/fungible/keeper/evm.go
Line: 622-623

Comment:
**Godoc comment name doesn't match function name**

Go's convention is that a doc comment must begin with the exact name of the symbol it documents so that `go doc` and IDEs can associate it correctly. Changing the comment to `BalanceOfZRC20` while the function is still named `BalanceOfZRC4` creates a mismatch — the same issue exists one function below for `TotalSupplyZRC4` (comment now reads `TotalSupplyZRC20`). Either revert the comment names to match the functions, or rename the functions themselves.

```suggestion
// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
```

How can I resolve this? If you propose a fix, please make it concise.

Comment thread x/fungible/keeper/evm.go Outdated
}

// DepositZRC20 deposits ZRC4 tokens into to account;
// DepositZRC20 deposits ZRC20 tokens into to account;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Missed typo: "into to" should be "into an"

The PR fixed a similar "and" → "an" typo in DepositZeta but left DepositZRC20 with the same malformed phrase.

Suggested change
// DepositZRC20 deposits ZRC20 tokens into to account;
// DepositZRC20 deposits ZRC20 tokens into an account;
Prompt To Fix With AI
This is a comment left during a code review.
Path: x/fungible/keeper/evm.go
Line: 245

Comment:
**Missed typo: "into to" should be "into an"**

The PR fixed a similar "and" → "an" typo in `DepositZeta` but left `DepositZRC20` with the same malformed phrase.

```suggestion
// DepositZRC20 deposits ZRC20 tokens into an account;
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
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.

Actionable comments posted: 3

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

Inline comments:
In `@x/fungible/keeper/evm.go`:
- Line 245: Update the comment for the DepositZRC20 function to fix the
grammar/typo ("into to account"); change it to a clear phrase such as
"DepositZRC20 deposits ZRC20 tokens into an account" or "DepositZRC20 deposits
ZRC20 tokens into the account" by editing the comment above the DepositZRC20
declaration so it reads correctly and matches surrounding comment style.
- Around line 650-651: The doc comment above the function is inconsistent: it
references "TotalSupplyZRC20" while the function is named TotalSupplyZRC4;
update the comment to match the function name by changing the comment to
"TotalSupplyZRC4 queries the total supply of a given ZRC4 contract" (or, if you
intend to standardize on ZRC20 instead, rename the function to TotalSupplyZRC20
and update all references accordingly); ensure the function signature
TotalSupplyZRC4 and any associated tests/docs use the same name to keep comments
and code aligned.
- Around line 622-623: Update the doc comment to match the function name: change
the opening comment from "BalanceOfZRC20 queries an account's balance for a
given ZRC20 contract" to "BalanceOfZRC4 queries an account's balance for a given
ZRC4 contract" (or otherwise replace ZRC20 with ZRC4) so the comment aligns with
the function BalanceOfZRC4; do not rename the function in this PR to avoid a
breaking change.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f47c00c1-fecf-4d23-96b5-edb991e6f58f

📥 Commits

Reviewing files that changed from the base of the PR and between 9a516a3 and 3d9d8fb.

📒 Files selected for processing (3)
  • x/crosschain/keeper/gas_payment.go
  • x/crosschain/keeper/msg_server_vote_outbound.go
  • x/fungible/keeper/evm.go

Comment thread x/fungible/keeper/evm.go Outdated
}

// DepositZRC20 deposits ZRC4 tokens into to account;
// DepositZRC20 deposits ZRC20 tokens into to account;
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix grammatical error in comment.

The comment contains a typo: "into to account" should be "into an account" or simply "into the account".

✏️ Proposed fix
-// DepositZRC20 deposits ZRC20 tokens into to account;
+// DepositZRC20 deposits ZRC20 tokens into an account;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// DepositZRC20 deposits ZRC20 tokens into to account;
// DepositZRC20 deposits ZRC20 tokens into an account;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@x/fungible/keeper/evm.go` at line 245, Update the comment for the
DepositZRC20 function to fix the grammar/typo ("into to account"); change it to
a clear phrase such as "DepositZRC20 deposits ZRC20 tokens into an account" or
"DepositZRC20 deposits ZRC20 tokens into the account" by editing the comment
above the DepositZRC20 declaration so it reads correctly and matches surrounding
comment style.

Comment thread x/fungible/keeper/evm.go Outdated
Comment on lines 622 to 623
// BalanceOfZRC20 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Comment/function name mismatch.

The comment describes "BalanceOfZRC20" but the function is named BalanceOfZRC4. This inconsistency may confuse readers. Either update the comment to match the function name, or if "ZRC4" is a legacy naming issue, consider updating the function name to BalanceOfZRC20 (though that would be a breaking change beyond the scope of this PR).

📝 Proposed fix to align comment with function name
-// BalanceOfZRC20 queries an account's balance for a given ZRC20 contract
+// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
 func (k Keeper) BalanceOfZRC4(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// BalanceOfZRC20 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
// BalanceOfZRC4 queries an account's balance for a given ZRC20 contract
func (k Keeper) BalanceOfZRC4(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@x/fungible/keeper/evm.go` around lines 622 - 623, Update the doc comment to
match the function name: change the opening comment from "BalanceOfZRC20 queries
an account's balance for a given ZRC20 contract" to "BalanceOfZRC4 queries an
account's balance for a given ZRC4 contract" (or otherwise replace ZRC20 with
ZRC4) so the comment aligns with the function BalanceOfZRC4; do not rename the
function in this PR to avoid a breaking change.

Comment thread x/fungible/keeper/evm.go Outdated
Comment on lines 650 to 651
// TotalSupplyZRC20 queries the total supply of a given ZRC20 contract
func (k Keeper) TotalSupplyZRC4(
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Comment/function name mismatch.

The comment describes "TotalSupplyZRC20" but the function is named TotalSupplyZRC4. This inconsistency may confuse readers. Either update the comment to match the function name, or if "ZRC4" is a legacy naming issue, consider updating the function name to TotalSupplyZRC20 (though that would be a breaking change beyond the scope of this PR).

📝 Proposed fix to align comment with function name
-// TotalSupplyZRC20 queries the total supply of a given ZRC20 contract
+// TotalSupplyZRC4 queries the total supply of a given ZRC20 contract
 func (k Keeper) TotalSupplyZRC4(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// TotalSupplyZRC20 queries the total supply of a given ZRC20 contract
func (k Keeper) TotalSupplyZRC4(
// TotalSupplyZRC4 queries the total supply of a given ZRC20 contract
func (k Keeper) TotalSupplyZRC4(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@x/fungible/keeper/evm.go` around lines 650 - 651, The doc comment above the
function is inconsistent: it references "TotalSupplyZRC20" while the function is
named TotalSupplyZRC4; update the comment to match the function name by changing
the comment to "TotalSupplyZRC4 queries the total supply of a given ZRC4
contract" (or, if you intend to standardize on ZRC20 instead, rename the
function to TotalSupplyZRC20 and update all references accordingly); ensure the
function signature TotalSupplyZRC4 and any associated tests/docs use the same
name to keep comments and code aligned.

Signed-off-by: criciss <cricis@msn.com>
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