Skip to content

Conversation

@oncecelll
Copy link

@oncecelll oncecelll commented Jan 10, 2026

Description

fix some function names in comment

How Has This Been Tested?

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

Summary by CodeRabbit

Release Notes

  • Refactor

    • Updated test infrastructure for revert scenario handling.
  • Documentation

    • Corrected documentation comment for public IP resolution.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: oncecelll <oncecell@outlook.com>
@oncecelll oncecelll requested a review from a team as a code owner January 10, 2026 10:23
@cursor
Copy link

cursor bot commented Jan 10, 2026

PR Summary

Minor comment-only fixes to align function names with their doc comments. No functional code changes.

  • Update comment to reference SuiCreateExampleWACPayloadForRevert in e2e/runner/sui.go
  • Rename comment header to ResolvePublicIP to match the function in zetaclient/config/types.go

Written by Cursor Bugbot for commit 05f869f. Configure here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

Two localized updates were made: a method in the Sui e2e runner was renamed and refactored to change its signature and return type, now accepting no parameters and returning an error alongside a payload; and a documentation comment was corrected in the zetaclient config types.

Changes

Cohort / File(s) Summary
E2E Runner Refactoring
e2e/runner/sui.go
Method SuiCreateExampleWACPayload renamed to SuiCreateExampleWACPayloadForRevert with signature change: removed authorizedSender and suiAddress parameters; updated return type from sui.CallPayload to (sui.CallPayload, error); implementation updated to encode revert condition in on_call.
Documentation Fix
zetaclient/config/types.go
Comment corrected for ResolvePublicIP function: changed description from "ResolvePublicDNS4" to "ResolvePublicIP" to match actual function name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides minimal context, stating only 'fix some function names in comment' without elaborating on specific changes or their rationale. Expand the description to specify which function names were corrected and provide context for why these corrections are necessary.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: correcting function names in comments across multiple files.
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 docstrings

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
e2e/runner/sui.go (1)

237-253: Consider removing the unused error return value.

This method consistently returns nil for the error. Given the E2E runner pattern documented in the learnings, methods in this context typically use assertions (require statements) rather than returning errors. The current signature is inconsistent with similar methods in this file (e.g., SuiGetSUIBalance at lines 30-41, SuiCreateExampleWACPayload at lines 210-235).

♻️ Proposed refactor to match E2E runner patterns
-// SuiCreateExampleWACPayloadForRevert creates a payload that triggers a revert in the 'on_call'
-// function in Sui the example package
-func (r *E2ERunner) SuiCreateExampleWACPayloadForRevert() (sui.CallPayload, error) {
+// SuiCreateExampleWACPayloadForRevert creates a payload that triggers a revert in the 'on_call'
+// function in Sui the example package
+func (r *E2ERunner) SuiCreateExampleWACPayloadForRevert() sui.CallPayload {
 	// only the CCTX's coinType is needed, no additional arguments
 	argumentTypes := []string{}
 	objects := []string{
 		r.SuiExample.GlobalConfigID.String(),
 		r.SuiExample.PartnerID.String(),
 		r.SuiExample.ClockID.String(),
 	}
 
 	// the 'on_call' method of the "connected" contract specifically throws an error
 	// for this message to trigger "tx revert" test case
 	message := []byte(onCallRevertMessage)
 
-	return sui.NewCallPayload(argumentTypes, objects, message), nil
+	return sui.NewCallPayload(argumentTypes, objects, message)
 }

Based on learnings, E2E runner balance check methods were refactored from error-returning to assertion-based approaches.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c796d6 and 05f869f.

📒 Files selected for processing (2)
  • e2e/runner/sui.go
  • zetaclient/config/types.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

⚙️ CodeRabbit configuration file

Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

Files:

  • zetaclient/config/types.go
  • e2e/runner/sui.go
🧠 Learnings (2)
📓 Common learnings
Learnt from: gartnera
Repo: zeta-chain/node PR: 3070
File: cmd/zetae2e/init.go:0-0
Timestamp: 2024-10-30T17:56:16.341Z
Learning: In code reviews for Go files like `cmd/zetae2e/init.go` in the ZetaChain project, avoid suggesting unrelated refactoring. Focus comments on changes relevant to the PR objectives.
Learnt from: gartnera
Repo: zeta-chain/node PR: 3228
File: zetaclient/orchestrator/orchestrator.go:388-401
Timestamp: 2024-11-27T22:01:49.732Z
Learning: When reviewing code changes in `zetaclient/orchestrator/orchestrator.go`, avoid suggesting refactoring that is unrelated to the current PR.
Learnt from: gartnera
Repo: zeta-chain/node PR: 3228
File: cmd/zetaclientd/start.go:222-231
Timestamp: 2024-11-27T22:02:48.034Z
Learning: In the `zetaclient` codebase, port numbers like `26657` are hardcoded, and changing them to be configurable via the config struct is considered unrelated refactoring.
Learnt from: kingpinXD
Repo: zeta-chain/node PR: 4064
File: cmd/zetae2e/local/solana.go:0-0
Timestamp: 2025-08-06T01:54:04.100Z
Learning: The `CheckSolanaTSSBalance()` method in e2e/runner has been refactored to not return an error. Instead, it uses internal assertions (require statements) to fail the test immediately if balance checks fail. This is part of a broader refactoring pattern in the E2E runner where balance check methods were changed from error-returning to assertion-based approaches.
Learnt from: skosito
Repo: zeta-chain/node PR: 3939
File: go.mod:52-52
Timestamp: 2025-05-30T16:31:30.275Z
Learning: The ethermint dependency updates in the zeta-chain/node repository are typically moves between feature branches and main branch of the same fork, not breaking API changes. CI status should be verified before assuming compilation issues.
Learnt from: kingpinXD
Repo: zeta-chain/node PR: 3503
File: e2e/runner/require.go:0-0
Timestamp: 2025-02-07T19:33:35.631Z
Learning: In e2e tests for the zeta-chain/node repository, minimize computation and avoid redundant checks that are already covered by unit tests to ensure faster execution. For example, ballot sorting is verified in unit tests, so e2e tests can safely assume the order.
Learnt from: lumtis
Repo: zeta-chain/node PR: 2459
File: e2e/config/config.go:285-293
Timestamp: 2024-07-11T13:10:39.153Z
Learning: Tests should not be suggested in the `e2e` package for the `zeta-chain/node` repository.
📚 Learning: 2025-08-06T01:54:04.100Z
Learnt from: kingpinXD
Repo: zeta-chain/node PR: 4064
File: cmd/zetae2e/local/solana.go:0-0
Timestamp: 2025-08-06T01:54:04.100Z
Learning: The `CheckSolanaTSSBalance()` method in e2e/runner has been refactored to not return an error. Instead, it uses internal assertions (require statements) to fail the test immediately if balance checks fail. This is part of a broader refactoring pattern in the E2E runner where balance check methods were changed from error-returning to assertion-based approaches.

Applied to files:

  • e2e/runner/sui.go
🔇 Additional comments (1)
zetaclient/config/types.go (1)

224-224: LGTM: Comment now correctly references the method name.

The documentation fix accurately reflects the actual method name ResolvePublicIP, resolving the inconsistency with the previously incorrect reference to ResolvePublicDNS4.

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.

3 participants