-
Notifications
You must be signed in to change notification settings - Fork 237
fix: resolve TODO by replacing panic with error return in UnbondTimestamp #360
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
📝 WalkthroughWalkthroughThe update modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant DataSource
Client->>API: Call UnbondTimestamp()
API->>DataSource: Request unbonding timestamp
alt Error occurs during retrieval
DataSource-->>API: Return error
API-->>Client: Return (0, error)
else Successful retrieval
DataSource-->>API: Return timestamp
API-->>Client: Return (timestamp, nil)
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (3)
🪧 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
x/move/keeper/api.go
(1 hunks)
🔇 Additional comments (1)
x/move/keeper/api.go (1)
21-21
:❓ Verification inconclusive
Verify interface compatibility after signature change
The method signature change for
UnbondTimestamp()
may require updating thevmapi.GoAPI
interface definition as well.
🏁 Script executed:
#!/bin/bash # Find the interface definition to verify if it needs to be updated rg -A 5 "type GoAPI interface" --glob "**/*.go"Length of output: 49
Action: Verify Interface Compatibility for
UnbondTimestamp()
The automated search for the
GoAPI
interface definition didn’t return any results, so we couldn’t confirm whether the method signature change forUnbondTimestamp()
is reflected in the interface. Please manually verify the definition ofvmapi.GoAPI
(likely in thevmapi
package) to ensure that its declaration matches the updated signature.Key points:
- Confirm that the interface declaration for
GoAPI
(if present) includes the updated signature forUnbondTimestamp()
.- Double-check that the type assertion in
x/move/keeper/api.go
(var _ vmapi.GoAPI = &GoApi{}
) is still valid.
Description
This PR resolves a TODO by modifying error handling.
Instead of abruptly stopping execution with a panic, the function now returns an error where applicable, allowing proper error handling.
Author Checklist
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...