status-go/protocol/requests/delete_community_token_permission.go
Pascal Precht 596660c110 feat: add CommunityTokenPermission to community description
This adds token permission capabilities to CommunityDescription such that token permissions can be created, updated and deleted.
2023-03-03 09:46:49 +01:00

27 lines
733 B
Go

package requests
import (
"errors"
"github.com/status-im/status-go/eth-node/types"
)
var ErrDeleteCommunityTokenPermissionInvalidCommunityID = errors.New("delete community token permission needs a valid community id ")
var ErrDeleteCommunityTokenPermissionInvalidPermissionID = errors.New("invalid token permission id")
type DeleteCommunityTokenPermission struct {
CommunityID types.HexBytes `json:"communityId"`
PermissionID string `json:"permissionId"`
}
func (r *DeleteCommunityTokenPermission) Validate() error {
if len(r.CommunityID) == 0 {
return ErrDeleteCommunityCategoryInvalidCommunityID
}
if len(r.PermissionID) == 0 {
return ErrDeleteCommunityTokenPermissionInvalidPermissionID
}
return nil
}