status-go/protocol/requests/ban_user_from_community.go

28 lines
644 B
Go
Raw Normal View History

package requests
import (
"errors"
"github.com/status-im/status-go/eth-node/types"
)
var ErrBanUserFromCommunityInvalidCommunityID = errors.New("ban-user-from-community: invalid community id")
var ErrBanUserFromCommunityInvalidUser = errors.New("ban-user-from-community: invalid user id")
type BanUserFromCommunity struct {
CommunityID types.HexBytes `json:"communityId"`
User types.HexBytes `json:"user"`
}
func (b *BanUserFromCommunity) Validate() error {
if len(b.CommunityID) == 0 {
return ErrBanUserFromCommunityInvalidCommunityID
}
if len(b.User) == 0 {
return ErrBanUserFromCommunityInvalidUser
}
return nil
}