@@ -6,17 +6,14 @@ import (
66
77 "github.com/ipfs/go-datastore"
88 "github.com/libp2p/go-libp2p"
9- pubsub "github.com/libp2p/go-libp2p-pubsub"
109 "github.com/libp2p/go-libp2p/p2p/net/conngater"
1110 "github.com/stretchr/testify/require"
1211 "go.uber.org/fx"
1312 "go.uber.org/fx/fxtest"
1413
15- "github.com/celestiaorg/go-fraud"
1614 libhead "github.com/celestiaorg/go-header"
1715 "github.com/celestiaorg/go-header/p2p"
1816 "github.com/celestiaorg/go-header/store"
19- "github.com/celestiaorg/go-header/sync"
2017
2118 "github.com/celestiaorg/celestia-node/header"
2219 "github.com/celestiaorg/celestia-node/libs/pidstore"
@@ -56,39 +53,6 @@ func TestConstructModule_StoreParams(t *testing.T) {
5653 require .Equal (t , headerStore .Params .WriteBatchSize , cfg .Store .WriteBatchSize )
5754}
5855
59- // TestConstructModule_SyncerParams ensures that all passed via functional options
60- // params are set in syncer correctly.
61- func TestConstructModule_SyncerParams (t * testing.T ) {
62- cfg := DefaultConfig (node .Light )
63- cfg .TrustedPeers = []string {"/ip4/1.2.3.4/tcp/12345/p2p/12D3KooWNaJ1y1Yio3fFJEXCZyd1Cat3jmrPdgkYCrHfKD3Ce21p" }
64- var syncer * sync.Syncer [* header.ExtendedHeader ]
65- app := fxtest .New (t ,
66- fx .Supply (node .Light ),
67- fx .Supply (modp2p .Private ),
68- fx .Supply (modp2p.Bootstrappers {}),
69- fx .Provide (context .Background ),
70- fx .Provide (libp2p .New ),
71- fx .Provide (func (b datastore.Batching ) (* conngater.BasicConnectionGater , error ) {
72- return conngater .NewBasicConnectionGater (b )
73- }),
74- fx .Provide (func () * pubsub.PubSub {
75- return nil
76- }),
77- fx .Provide (func () datastore.Batching {
78- return datastore .NewMapDatastore ()
79- }),
80- fx .Provide (func () fraud.Service [* header.ExtendedHeader ] {
81- return nil
82- }),
83- ConstructModule [* header.ExtendedHeader ](node .Light , & cfg ),
84- fx .Invoke (func (s * sync.Syncer [* header.ExtendedHeader ]) {
85- syncer = s
86- }),
87- )
88- require .Equal (t , cfg .Syncer .TrustingPeriod , syncer .Params .TrustingPeriod )
89- require .NoError (t , app .Err ())
90- }
91-
9256// TestConstructModule_ExchangeParams ensures that all passed via functional options
9357// params are set in store correctly.
9458func TestConstructModule_ExchangeParams (t * testing.T ) {
0 commit comments