-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(iavlx): membership and nonmembership proofs #25579
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: aaronc/iavlx-sim-bench
Are you sure you want to change the base?
Conversation
|
@technicallyty your pull request is missing a changelog! |
| return nil, err | ||
| } | ||
| if rightNode != nil { | ||
| rightKey, err := rightNode.Key() |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
The best way to fix this problem is to handle the potential error from rightNode.Key() similarly to how it is handled for leftNode.Key(). That is, after calling rightKey, err := rightNode.Key(), check if err != nil and return early if it's not nil. This ensures that any unexpected error is handled gracefully and won't be missed.
Specifically, update the code at line 137 by assigning both rightKey and err, then immediately test err before progressing. You do not need to change any function signatures or imports. Only this code block inside GetNonMembershipProof is changed.
-
Copy modified lines R138-R140
| @@ -135,7 +135,9 @@ | ||
| } | ||
| if rightNode != nil { | ||
| rightKey, err := rightNode.Key() | ||
|
|
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if rightKey != nil { | ||
| nonexist.Right, err = createExistenceProof(root, rightKey) | ||
| if err != nil { |
Description
Closes: #25573
Implements membership and non-membership proofs on IAVLX tree