Skip to content

Commit

Permalink
fix: add WithClusterID to see its effect
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzac committed Mar 28, 2024
1 parent dc4ed27 commit 4266513
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions waku/v2/node/wakunode2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,23 @@ func TestStaticShardingMultipleTopics(t *testing.T) {
wakuNode1, err := New(
WithHostAddress(hostAddr1),
WithWakuRelay(),
WithClusterID(uint16(20)),
)
require.NoError(t, err)
err = wakuNode1.Start(ctx)
require.NoError(t, err)
defer wakuNode1.Stop()

pubSubTopic1 := protocol.NewStaticShardingPubsubTopic(uint16(0), uint16(0))
pubSubTopic1 := protocol.NewStaticShardingPubsubTopic(uint16(21), uint16(0))
pubSubTopic1Str := pubSubTopic1.String()
contentTopic1 := "/test/2/my-app/sharded"

pubSubTopic2 := protocol.NewStaticShardingPubsubTopic(uint16(0), uint16(10))
pubSubTopic2 := protocol.NewStaticShardingPubsubTopic(uint16(21), uint16(10))
pubSubTopic2Str := pubSubTopic2.String()
contentTopic2 := "/test/3/my-app/sharded"

require.Equal(t, uint16(20), wakuNode1.ClusterID())

r := wakuNode1.Relay()

subs1, err := r.Subscribe(ctx, protocol.NewContentFilter(pubSubTopic1Str, contentTopic1))
Expand Down

0 comments on commit 4266513

Please sign in to comment.