@@ -107,7 +107,7 @@ func TestFraudProofSyncing(t *testing.T) {
107107 store := nodebuilder .MockStore (t , cfg )
108108 bridge := sw .NewNodeWithStore (node .Bridge , store , core .WithHeaderConstructFn (header .FraudMaker (t , 10 )))
109109
110- ctx , cancel := context .WithTimeout (context .Background (), time . Minute * 5 )
110+ ctx , cancel := context .WithTimeout (context .Background (), swamp . DefaultTestTimeout )
111111 t .Cleanup (cancel )
112112
113113 err := bridge .Start (ctx )
@@ -123,21 +123,24 @@ func TestFraudProofSyncing(t *testing.T) {
123123 lightCfg := nodebuilder .DefaultConfig (node .Light )
124124 lightCfg .P2P .RoutingTableRefreshPeriod = defaultTimeInterval
125125 lightCfg .Share .DiscoveryInterval = defaultTimeInterval
126- ln := sw . NewNodeWithStore ( node . Light , nodebuilder . MockStore ( t , lightCfg ),
127- nodebuilder . WithBootstrappers ([]peer. AddrInfo { * addr } ))
126+ lightCfg . Header . TrustedPeers = append ( lightCfg . Header . TrustedPeers , addrs [ 0 ]. String ())
127+ ln := sw . NewNodeWithStore ( node . Light , nodebuilder . MockStore ( t , lightCfg ))
128128
129129 require .NoError (t , full .Start (ctx ))
130+ require .NoError (t , ln .Start (ctx ))
130131 subsFn , err := full .FraudServ .Subscribe (fraud .BadEncoding )
131132 require .NoError (t , err )
132133 defer subsFn .Cancel ()
133134 _ , err = subsFn .Proof (ctx )
134135 require .NoError (t , err )
135136
136- require .NoError (t , ln .Start (ctx ))
137137 // internal subscription for the fraud proof is done in order to ensure that light node
138138 // receives the BEFP.
139139 subsLn , err := ln .FraudServ .Subscribe (fraud .BadEncoding )
140140 require .NoError (t , err )
141+
142+ err = ln .Host .Connect (ctx , * host .InfoFromHost (full .Host ))
143+ require .NoError (t , err )
141144 _ , err = subsLn .Proof (ctx )
142145 require .NoError (t , err )
143146 subsLn .Cancel ()
0 commit comments