status-go/protocol/requests/invite_users_to_community.go

28 lines
594 B
Go
Raw Normal View History

2021-01-11 10:32:51 +00:00
package requests
import (
"errors"
"github.com/status-im/status-go/eth-node/types"
)
var ErrInviteUsersToCommunityInvalidID = errors.New("invite-users-to-community: invalid id")
var ErrInviteUsersToCommunityEmptyUsers = errors.New("invite-users-to-community: empty users")
type InviteUsersToCommunity struct {
CommunityID types.HexBytes
Users []types.HexBytes
}
func (j *InviteUsersToCommunity) Validate() error {
if len(j.CommunityID) == 0 {
return ErrInviteUsersToCommunityInvalidID
}
if len(j.Users) == 0 {
return ErrInviteUsersToCommunityEmptyUsers
}
return nil
}