-
Notifications
You must be signed in to change notification settings - Fork 634
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: update enforce sub-authenticator to be greater than 1 error message #8676
Conversation
WalkthroughThe changes involve an update to the error messaging in the handling of sub-authenticators within the software. Specifically, the error message in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Authenticator
User->>Authenticator: Add sub-authenticators
alt If sub-authenticators <= 1
Authenticator-->>User: Return error with updated message
else
Authenticator-->>User: Proceed with operation
end
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review due to trivial changes (1)
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: 1
@@ -49,7 +49,7 @@ func onSubAuthenticatorsAdded(ctx sdk.Context, account sdk.AccAddress, data []by | |||
} | |||
|
|||
if len(initDatas) <= 1 { | |||
return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "no sub-authenticators provided") | |||
return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "at least 2 sub-authenticators must be provided, but got %d", len(initDatas)) |
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.
Improved error message for clarity.
The updated error message at line 52 enhances user understanding by specifying the exact requirement and the current count of sub-authenticators. This change aligns well with the PR's objectives to improve error message clarity.
However, consider adding a unit test to verify that this specific error condition is handled correctly, especially since the PR description mentions that no new tests were included.
What is the purpose of the change
Update error message according to logic changes in #8375
Testing and Verifying
This change is a trivial rework / code cleanup without any test coverage.