func (partyIDs IDSlice) Valid() bool {
	n := len(partyIDs)
	for i := 1; i < n; i++ {
		if partyIDs[i-1] >= partyIDs[i] {
			return false
		}
	}
	return true
}
Valid returns true if the IDSlice is sorted and does not contain any duplicates.
package party
import (
	"encoding/binary"
	"io"
	"sort"
	"strings"
)
type IDSlice []ID
func NewIDSlice(partyIDs []ID) IDSlice {
	ids := IDSlice(partyIDs).Copy()
	ids.sort()
	return ids
}
func (partyIDs IDSlice) Contains(ids ...ID) bool {
	for _, id := range ids {
		if _, ok := partyIDs.search(id); !ok {
			return false
		}
	}
	return true
}