diff --git a/x/subscription/keeper/msg_server.go b/x/subscription/keeper/msg_server.go index cc05575e..ef2f4163 100644 --- a/x/subscription/keeper/msg_server.go +++ b/x/subscription/keeper/msg_server.go @@ -283,6 +283,9 @@ func (k *msgServer) MsgUpdateQuota(c context.Context, msg *types.MsgUpdateQuotaR if !found { return nil, types.ErrorSubscriptionDoesNotExist } + if subscription.Plan == 0 { + return nil, types.ErrorCanNotUpdateQuota + } if msg.From != subscription.Owner { return nil, types.ErrorUnauthorized } diff --git a/x/subscription/types/errors.go b/x/subscription/types/errors.go index 7dd4f661..39ae2152 100644 --- a/x/subscription/types/errors.go +++ b/x/subscription/types/errors.go @@ -28,5 +28,6 @@ var ( ErrorDuplicateQuota = errors.Register(ModuleName, 211, "duplicate quota") ErrorQuotaDoesNotExist = errors.Register(ModuleName, 212, "quota does not exist") ErrorCanNotAddQuota = errors.Register(ModuleName, 213, "can not add quota") - ErrorCanNotCancel = errors.Register(ModuleName, 214, "can not cancel") + ErrorCanNotUpdateQuota = errors.Register(ModuleName, 214, "can not update quota") + ErrorCanNotCancel = errors.Register(ModuleName, 215, "can not cancel") )