mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-02-26 00:33:14 +00:00
feat: added getter for Subscription.contentFilter
This commit is contained in:
parent
1deafd1e47
commit
aabd99e17f
@ -3,8 +3,9 @@ package relay
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/waku-org/go-waku/waku/v2/protocol"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"github.com/waku-org/go-waku/waku/v2/protocol"
|
||||
)
|
||||
|
||||
// Subscription handles the details of a particular Topic subscription. There may be many subscriptions for a given topic.
|
||||
@ -55,3 +56,7 @@ func NewSubscription(contentFilter protocol.ContentFilter) *Subscription {
|
||||
subType: subType,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Subscription) ContentFilter() protocol.ContentFilter {
|
||||
return s.contentFilter
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
"github.com/libp2p/go-libp2p/core/peerstore"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/waku-org/go-waku/logging"
|
||||
"github.com/waku-org/go-waku/tests"
|
||||
"github.com/waku-org/go-waku/waku/v2/protocol"
|
||||
@ -403,7 +404,7 @@ func TestInvalidMessagePublish(t *testing.T) {
|
||||
_, err = relay.Publish(ctx, message, WithPubSubTopic(testTopic))
|
||||
require.Error(t, err)
|
||||
|
||||
err = relay.Unsubscribe(protocol.NewContentFilter(subs[0].contentFilter.PubsubTopic))
|
||||
err = relay.Unsubscribe(ctx, protocol.NewContentFilter(subs[0].contentFilter.PubsubTopic))
|
||||
require.NoError(t, err)
|
||||
|
||||
ctxCancel()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user