-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
refactor(crypto): add check in multisig verification #23395
Conversation
📝 WalkthroughWalkthroughThe pull request introduces enhanced validation checks in the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)tests/integration/auth/client/cli/suite_test.go (3)Pattern Pattern Pattern ⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (2)
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
Documentation and Community
|
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.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
crypto/keys/multisig/multisig_test.go
(4 hunks)tests/integration/auth/client/cli/suite_test.go
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crypto/keys/multisig/multisig_test.go
🧰 Additional context used
📓 Path-based instructions (1)
tests/integration/auth/client/cli/suite_test.go (3)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern tests/**/*
: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"
Pattern **/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"
🪛 golangci-lint (1.62.2)
tests/integration/auth/client/cli/suite_test.go
90-90: Error return value of kb.SaveOfflineKey
is not checked
(errcheck)
🪛 GitHub Actions: Tests / Code Coverage
tests/integration/auth/client/cli/suite_test.go
[error] 521-954: Multiple test failures due to 'cannot sign with offline keys' error in TestCLITestSuite
[warning] Low test coverage: 4.1% of statements
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: test-system-v2
- GitHub Check: Analyze
- GitHub Check: Summary
🔇 Additional comments (2)
tests/integration/auth/client/cli/suite_test.go (2)
108-109
: LGTM! Good test coverage for N > M validation.The 2-of-3 multisig configuration provides a good test case for validating the N > M rule, where N (number of keys = 3) is greater than M (threshold = 2).
🧰 Tools
🪛 GitHub Actions: Tests / Code Coverage
[warning] Low test coverage: 4.1% of statements
Line range hint
1-954
: Address test failures and improve test coverage.
- Multiple test failures are occurring with the error 'cannot sign with offline keys'. This needs investigation and fixing.
- The test coverage is very low at 4.1%. Consider adding more test cases to improve coverage.
Run this script to help identify the failing test cases:
🧰 Tools
🪛 golangci-lint (1.62.2)
90-90: Error return value of
kb.SaveOfflineKey
is not checked(errcheck)
🪛 GitHub Actions: Tests / Code Coverage
[warning] Low test coverage: 4.1% of statements
pub, err := valAcc.GetPubKey() | ||
s.Require().NoError(err) | ||
kb.SaveOfflineKey("newAccount", pub) |
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.
🛠️ Refactor suggestion
Add error handling for SaveOfflineKey.
The error returned by kb.SaveOfflineKey
should be checked for consistency with the error handling pattern used throughout the test suite.
pub, err := valAcc.GetPubKey()
s.Require().NoError(err)
-kb.SaveOfflineKey("newAccount", pub)
+err = kb.SaveOfflineKey("newAccount", pub)
+s.Require().NoError(err)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
pub, err := valAcc.GetPubKey() | |
s.Require().NoError(err) | |
kb.SaveOfflineKey("newAccount", pub) | |
pub, err := valAcc.GetPubKey() | |
s.Require().NoError(err) | |
err = kb.SaveOfflineKey("newAccount", pub) | |
s.Require().NoError(err) |
🧰 Tools
🪛 golangci-lint (1.62.2)
90-90: Error return value of kb.SaveOfflineKey
is not checked
(errcheck)
🪛 GitHub Actions: Tests / Code Coverage
[warning] Low test coverage: 4.1% of statements
Co-authored-by: Alex | Interchain Labs <[email protected]> (cherry picked from commit 642e881)
#23438) Co-authored-by: Marko <[email protected]>
Description
this pr adds an extra check to multisig verification. this puts a requirement that all multisigs follow the below ruleset N > M and M > 0
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers 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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
Tests
Bug Fixes