Skip to content
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

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#8628](https://github.com/osmosis-labs/osmosis/pull/8628) chore: add tagged cometbft version: v0.38.11-v26-osmo-1
* [#8649](https://github.com/osmosis-labs/osmosis/pull/8649) chore: update to tagged submodules
* [#8663](https://github.com/osmosis-labs/osmosis/pull/8663) fix: protorev throws a nil pointer
* [#8676](https://github.com/osmosis-labs/osmosis/pull/8676) fix: update enforce sub-authenticator to be greater than 1 error message

### Config

Expand Down
2 changes: 1 addition & 1 deletion x/smart-account/authenticator/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Copy link
Contributor

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.

}

baseId := authenticatorId
Expand Down