-
Couldn't load subscription status.
- Fork 162
chore: fix inconsistent function name in comment #3048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: billcarsoon <[email protected]>
WalkthroughPublic helper functions in deprecated_state.go were renamed to include “All,” with comments updated accordingly. A doc comment in sweep_funds.go was corrected to match the function name. No logic, behavior, or control flow changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (3)
protocol/x/vault/keeper/sweep_funds.go (1)
10-10: Docstring fix looks good; minor nit on capitalization.Consider capitalizing “USDC” in the doc comment for consistency with asset naming elsewhere.
Apply this diff:
-// SweepMainVaultBankBalance deposits any usdc balance from the Megavault main vault bank balance +// SweepMainVaultBankBalance deposits any USDC balance from the Megavault main vault bank balanceprotocol/x/vault/keeper/deprecated_state.go (2)
214-216: Comment doesn't match function behavior (operates on all vaults, not a given vault).This helper deletes all total-shares entries across all vaults. Update the wording to avoid “a given vault.”
-// UnsafeDeleteAllVaultTotalShares deletes total shares of a given vault from state. +// UnsafeDeleteAllVaultTotalShares deletes total shares for all vaults from deprecated state.
225-227: Comment also implies per-vault deletion; this function deletes across all vaults.Adjust the doc to reflect that it wipes owner shares for all vaults.
-// UnsafeDeleteAllVaultOwnerShares deletes all owner shares of a given vault from state. +// UnsafeDeleteAllVaultOwnerShares deletes all owner shares across all vaults from deprecated state.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
protocol/x/vault/keeper/deprecated_state.go(2 hunks)protocol/x/vault/keeper/sweep_funds.go(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: hwray
PR: dydxprotocol/v4-chain#2551
File: protocol/x/clob/types/expected_keepers.go:86-90
Timestamp: 2024-11-15T16:17:29.092Z
Learning: The function `GetCrossInsuranceFundBalance` in `protocol/x/clob/types/expected_keepers.go` already existed and was just moved in this PR; changes to its error handling may be out of scope.
Learnt from: hwray
PR: dydxprotocol/v4-chain#2551
File: protocol/x/subaccounts/keeper/subaccount.go:852-865
Timestamp: 2024-11-15T16:00:11.304Z
Learning: The function `GetCrossInsuranceFundBalance` in `protocol/x/subaccounts/keeper/subaccount.go` already existed and was just moved in this PR; changes to its error handling may be out of scope.
Learnt from: hwray
PR: dydxprotocol/v4-chain#2551
File: protocol/x/subaccounts/keeper/subaccount.go:833-850
Timestamp: 2024-11-15T15:59:28.095Z
Learning: The function `GetInsuranceFundBalance` in `protocol/x/subaccounts/keeper/subaccount.go` already existed and was just moved in this PR; changes to its error handling may be out of scope.
📚 Learning: 2024-11-15T16:17:29.092Z
Learnt from: hwray
PR: dydxprotocol/v4-chain#2551
File: protocol/x/clob/types/expected_keepers.go:86-90
Timestamp: 2024-11-15T16:17:29.092Z
Learning: The function `GetCrossInsuranceFundBalance` in `protocol/x/clob/types/expected_keepers.go` already existed and was just moved in this PR; changes to its error handling may be out of scope.
Applied to files:
protocol/x/vault/keeper/sweep_funds.go
📚 Learning: 2024-11-15T16:00:11.304Z
Learnt from: hwray
PR: dydxprotocol/v4-chain#2551
File: protocol/x/subaccounts/keeper/subaccount.go:852-865
Timestamp: 2024-11-15T16:00:11.304Z
Learning: The function `GetCrossInsuranceFundBalance` in `protocol/x/subaccounts/keeper/subaccount.go` already existed and was just moved in this PR; changes to its error handling may be out of scope.
Applied to files:
protocol/x/vault/keeper/sweep_funds.go
📚 Learning: 2024-11-15T15:59:28.095Z
Learnt from: hwray
PR: dydxprotocol/v4-chain#2551
File: protocol/x/subaccounts/keeper/subaccount.go:833-850
Timestamp: 2024-11-15T15:59:28.095Z
Learning: The function `GetInsuranceFundBalance` in `protocol/x/subaccounts/keeper/subaccount.go` already existed and was just moved in this PR; changes to its error handling may be out of scope.
Applied to files:
protocol/x/vault/keeper/sweep_funds.go
⏰ 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). (1)
- GitHub Check: Summary
🔇 Additional comments (1)
protocol/x/vault/keeper/deprecated_state.go (1)
214-234: Rename fully applied – old methods no longer referenced.Confirmed no usages of
UnsafeDeleteVaultTotalSharesorUnsafeDeleteVaultOwnerShares, and all call sites invoke the new methods:
- protocol/app/upgrades/v7.0/upgrade.go:155 k.UnsafeDeleteAllVaultTotalShares(ctx)
- protocol/app/upgrades/v7.0/upgrade.go:157 k.UnsafeDeleteAllVaultOwnerShares(ctx)
Changelist
[Describe or list the changes made in this PR]
fix inconsistent function name in comment
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breakinglabel.indexer-postgres-breakinglabel.PrepareProposalorProcessProposal, manually add the labelproposal-breaking.feature:[feature-name].backport/[branch-name].refactor,chore,bug.Summary by CodeRabbit
User impact: No changes to features, workflows, or performance. No API or configuration updates required. No action needed.