Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Oct 13, 2023
1 parent 4108883 commit 510d51d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions core/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ func TestListener(t *testing.T) {

// create mocknet with two pubsub endpoints
ps0, ps1 := createMocknetWithTwoPubsubEndpoints(ctx, t)
subscriber := p2p.NewSubscriber[*header.ExtendedHeader](ps1, header.MsgID, p2p.WithSubscriberNetworkID(networkID))
err := subscriber.SetVerifier(func(context.Context, *header.ExtendedHeader) error {
subscriber, err := p2p.NewSubscriber[*header.ExtendedHeader](
ps1,
header.MsgID,
p2p.WithSubscriberNetworkID(networkID),
)
require.NoError(t, err)
err = subscriber.SetVerifier(func(context.Context, *header.ExtendedHeader) error {
return nil
})
require.NoError(t, err)
Expand Down Expand Up @@ -162,8 +167,9 @@ func createListener(
edsSub *shrexsub.PubSub,
store *eds.Store,
) *Listener {
p2pSub := p2p.NewSubscriber[*header.ExtendedHeader](ps, header.MsgID, p2p.WithSubscriberNetworkID(networkID))
err := p2pSub.Start(ctx)
p2pSub, err := p2p.NewSubscriber[*header.ExtendedHeader](ps, header.MsgID, p2p.WithSubscriberNetworkID(networkID))
require.NoError(t, err)
err = p2pSub.Start(ctx)
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, p2pSub.Stop(ctx))
Expand Down
2 changes: 1 addition & 1 deletion nodebuilder/header/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func ConstructModule[H libhead.Header[H]](tp node.Type, cfg *Config) fx.Option {
}),
)),
fx.Provide(fx.Annotate(
func(cfg Config, ps *pubsub.PubSub, network modp2p.Network) *p2p.Subscriber[H] {
func(cfg Config, ps *pubsub.PubSub, network modp2p.Network) (*p2p.Subscriber[H], error) {
opts := []p2p.SubscriberOption{p2p.WithSubscriberNetworkID(network.String())}
if cfg.MetricsEnabled {
opts = append(opts, p2p.WithSubscriberMetrics())
Expand Down

0 comments on commit 510d51d

Please sign in to comment.