Skip to content

Commit

Permalink
feat(p2p): add subscriber params override opt
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Oct 12, 2023
1 parent 27e85f9 commit 074f77f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions p2p/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ func WithSubscriberNetworkID(networkID string) SubscriberOption {
}
}

// WithSubscriberParams is a functional option that overrides SubscriberParams.
func WithSubscriberParams(params SubscriberParams) SubscriberOption {
return func(p *SubscriberParams) {
*p = params
}
}

// NewSubscriber returns a Subscriber that manages the header Module's
// relationship with the "header-sub" gossipsub topic.
func NewSubscriber[H header.Header[H]](
Expand Down

0 comments on commit 074f77f

Please sign in to comment.