Skip to content

Commit

Permalink
fix(x/warden): prevent adding invalid addresses as keychain parties
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitasi committed Apr 4, 2024
1 parent 2e56659 commit 2304f90
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 2304f90

Please sign in to comment.