Skip to content

Commit

Permalink
Merge branch 'master' into rest/validate-lp-request
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos authored Apr 9, 2024
2 parents 9a5f658 + 3f69fb3 commit f1a6d21
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions waku/v2/protocol/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/binary"
"errors"
"fmt"
"math"
"strings"

"github.com/waku-org/go-waku/waku/v2/hash"
Expand All @@ -20,7 +19,6 @@ const ClusterIndex = 1
const GenerationZeroShardsCount = 8

var (
ErrTooManyShards = errors.New("too many shards")
ErrInvalidShard = errors.New("invalid shard")
ErrInvalidShardCount = errors.New("invalid shard count")
ErrExpected130Bytes = errors.New("invalid data: expected 130 bytes")
Expand All @@ -32,10 +30,6 @@ type RelayShards struct {
}

func NewRelayShards(clusterID uint16, shardIDs ...uint16) (RelayShards, error) {
if len(shardIDs) > math.MaxUint8 {
return RelayShards{}, ErrTooManyShards
}

shardIDSet := make(map[uint16]struct{})
for _, index := range shardIDs {
if index > MaxShardIndex {
Expand Down Expand Up @@ -142,10 +136,6 @@ func (rs RelayShards) ContainsTopic(topic string) bool {
}

func (rs RelayShards) ShardList() ([]byte, error) {
if len(rs.ShardIDs) > math.MaxUint8 {
return nil, ErrTooManyShards
}

var result []byte

result = binary.BigEndian.AppendUint16(result, rs.ClusterID)
Expand Down

0 comments on commit f1a6d21

Please sign in to comment.