Skip to content

Commit

Permalink
pr changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroms committed Feb 20, 2024
1 parent 677d7e9 commit 76b61f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions x/projects/types/message_set_admin_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ func (msg *MsgSetPolicy) ValidateBasic() error {
return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}

if _, ok := planstypes.Geolocation_name[msg.Policy.GeolocationProfile]; !ok {
return sdkerrors.Wrapf(legacyerrors.ErrInvalidType, "invalid geolocationprofile")
if msg.Policy != nil {
if err := msg.Policy.ValidateBasicPolicy(false); err != nil {
return sdkerrors.Wrapf(err, "invalid policy")
}
}

return nil
Expand Down
6 changes: 4 additions & 2 deletions x/projects/types/message_set_subscription_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ func (msg *MsgSetSubscriptionPolicy) ValidateBasic() error {
return sdkerrors.Wrapf(legacyerrors.ErrInvalidAddress, "invalid creator address (%s)", err)
}

if _, ok := planstypes.Geolocation_name[msg.Policy.GeolocationProfile]; !ok {
return sdkerrors.Wrapf(legacyerrors.ErrInvalidType, "invalid geolocationprofile")
if msg.Policy != nil {
if err := msg.Policy.ValidateBasicPolicy(false); err != nil {
return sdkerrors.Wrapf(err, "invalid policy")
}
}

return nil
Expand Down

0 comments on commit 76b61f9

Please sign in to comment.