-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix(typo): correct spelling mistakes #921
Conversation
WalkthroughThe pull request focuses on renaming several migration-related functions in the Changes
Possibly related PRs
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
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 (2)
app/upgrades/v8/upgrade.go (2)
Line range hint
215-223
: Document or configure the crisis fee amount.The crisis fee amount is hardcoded to
133e18
. Consider:
- Moving this to a configuration constant
- Adding a comment explaining the reasoning behind this specific value
+// CrisisConstantFee defines the default crisis fee in PUNDIAI (133 PUNDIAI) +const CrisisConstantFee = 133 func migrateCrisisModule(ctx sdk.Context, crisisKeeper *crisiskeeper.Keeper) error { constantFee, err := crisisKeeper.ConstantFee.Get(ctx) if err != nil { return err } constantFee.Denom = fxtypes.DefaultDenom - constantFee.Amount = sdkmath.NewInt(133).MulRaw(1e18) + constantFee.Amount = sdkmath.NewInt(CrisisConstantFee).MulRaw(1e18) return crisisKeeper.ConstantFee.Set(ctx, constantFee) }
Line range hint
231-242
: Enhance error handling in governance parameter migration.The function performs multiple critical operations sequentially. Consider adding detailed error wrapping to help with debugging if any step fails.
func migrateGovCustomParam(ctx sdk.Context, keeper *fxgovkeeper.Keeper, storeKey *storetypes.KVStoreKey) error { // 1. delete fxParams key - store.RemoveStoreKeys(ctx, storeKey, fxgovv8.GetRemovedStoreKeys()) + if err := store.RemoveStoreKeys(ctx, storeKey, fxgovv8.GetRemovedStoreKeys()); err != nil { + return fmt.Errorf("failed to remove old gov params: %w", err) + } // 2. init custom params if err := keeper.InitCustomParams(ctx); err != nil { - return err + return fmt.Errorf("failed to initialize custom params: %w", err) } // 3. set default params - return migrateGovDefaultParams(ctx, keeper) + if err := migrateGovDefaultParams(ctx, keeper); err != nil { + return fmt.Errorf("failed to migrate default params: %w", err) + } + return nil }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/upgrades/v8/upgrade.go
(5 hunks)app/upgrades/v8/wrap_token.go
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/upgrades/v8/wrap_token.go
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Mergify Merge Protections
- GitHub Check: Summary
🔇 Additional comments (2)
app/upgrades/v8/upgrade.go (2)
102-102
: LGTM! Consistent function renaming.The renaming from "migration" to "migrate" prefix improves code consistency and readability.
Also applies to: 105-105, 134-134, 136-136, 146-146, 211-212, 215-215, 231-231
Line range hint
46-57
: Verify error handling in upgrade handlers.The upgrade handlers use cache context for atomic operations, which is good. However, ensure that all error paths properly revert state changes, especially in the testnet upgrade path where errors are returned without explicit cache discard.
Summary by CodeRabbit