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(x/warden): prevent adding invalid addresses as keychain parties #152

Merged
merged 2 commits into from
Apr 4, 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 @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* (x/intent) [#139](https://github.com/warden-protocol/wardenprotocol/pull/139) Ability for modules to dynamically resolve variables on Action creation
* x/warden can now resolve `warden.space.owners` in Intent definitions into the list of owners of the space
* (x/intent) [#151](https://github.com/warden-protocol/wardenprotocol/pull/151) Store Intents' AST, instead of the raw string
* (x/warden) [#152](https://github.com/warden-protocol/wardenprotocol/pull/152) Prevent adding invalid addresses as Keychain parties

### Features

Expand Down
5 changes: 5 additions & 0 deletions warden/x/warden/keeper/msg_server_add_keychain_party.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import (
func (k msgServer) AddKeychainParty(goCtx context.Context, msg *types.MsgAddKeychainParty) (*types.MsgAddKeychainPartyResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

_, err := sdk.AccAddressFromBech32(msg.Party)
if err != nil {
return nil, fmt.Errorf("invalid party address: %s", err)
}

kr, err := k.keychains.Get(ctx, msg.KeychainId)
if err != nil {
return nil, err
Expand Down
Loading