@@ -66,7 +66,12 @@ func TestSequentialAnnouncementsLes2(t *testing.T) { testSequentialAnnouncements
6666func TestSequentialAnnouncementsLes3 (t * testing.T ) { testSequentialAnnouncements (t , 3 ) }
6767
6868func testSequentialAnnouncements (t * testing.T , protocol int ) {
69- s , c , teardown := newClientServerEnv (t , 4 , protocol , nil , nil , 0 , false , false , true )
69+ netconfig := testnetConfig {
70+ blocks : 4 ,
71+ protocol : protocol ,
72+ nopruning : true ,
73+ }
74+ s , c , teardown := newClientServerEnv (t , netconfig )
7075 defer teardown ()
7176
7277 // Create connected peer pair.
@@ -101,7 +106,12 @@ func TestGappedAnnouncementsLes2(t *testing.T) { testGappedAnnouncements(t, 2) }
101106func TestGappedAnnouncementsLes3 (t * testing.T ) { testGappedAnnouncements (t , 3 ) }
102107
103108func testGappedAnnouncements (t * testing.T , protocol int ) {
104- s , c , teardown := newClientServerEnv (t , 4 , protocol , nil , nil , 0 , false , false , true )
109+ netconfig := testnetConfig {
110+ blocks : 4 ,
111+ protocol : protocol ,
112+ nopruning : true ,
113+ }
114+ s , c , teardown := newClientServerEnv (t , netconfig )
105115 defer teardown ()
106116
107117 // Create connected peer pair.
@@ -183,7 +193,13 @@ func testTrustedAnnouncement(t *testing.T, protocol int) {
183193 ids = append (ids , n .String ())
184194 }
185195 }
186- _ , c , teardown := newClientServerEnv (t , 0 , protocol , nil , ids , 60 , false , false , true )
196+ netconfig := testnetConfig {
197+ protocol : protocol ,
198+ nopruning : true ,
199+ ulcServers : ids ,
200+ ulcFraction : 60 ,
201+ }
202+ _ , c , teardown := newClientServerEnv (t , netconfig )
187203 defer teardown ()
188204 defer func () {
189205 for i := 0 ; i < len (teardowns ); i ++ {
@@ -233,8 +249,17 @@ func testTrustedAnnouncement(t *testing.T, protocol int) {
233249 check ([]uint64 {10 }, 10 , func () { <- newHead }) // Sync the whole chain.
234250}
235251
236- func TestInvalidAnnounces (t * testing.T ) {
237- s , c , teardown := newClientServerEnv (t , 4 , lpv3 , nil , nil , 0 , false , false , true )
252+ func TestInvalidAnnouncesLES2 (t * testing.T ) { testInvalidAnnounces (t , lpv2 ) }
253+ func TestInvalidAnnouncesLES3 (t * testing.T ) { testInvalidAnnounces (t , lpv3 ) }
254+ func TestInvalidAnnouncesLES4 (t * testing.T ) { testInvalidAnnounces (t , lpv4 ) }
255+
256+ func testInvalidAnnounces (t * testing.T , protocol int ) {
257+ netconfig := testnetConfig {
258+ blocks : 4 ,
259+ protocol : protocol ,
260+ nopruning : true ,
261+ }
262+ s , c , teardown := newClientServerEnv (t , netconfig )
238263 defer teardown ()
239264
240265 // Create connected peer pair.
0 commit comments