@@ -22,12 +22,11 @@ func TestProtocolCompatibility(t *testing.T) {
22
22
// Define the compatibility chart
23
23
tests := []struct {
24
24
version uint
25
- mode Mode
25
+ fastSync bool
26
26
compatible bool
27
27
}{
28
- {61 , ArchiveMode , true }, {62 , ArchiveMode , true }, {63 , ArchiveMode , true }, {64 , ArchiveMode , true },
29
- {61 , FullMode , false }, {62 , FullMode , false }, {63 , FullMode , true }, {64 , FullMode , true },
30
- {61 , LightMode , false }, {62 , LightMode , false }, {63 , LightMode , false }, {64 , LightMode , true },
28
+ {61 , false , true }, {62 , false , true }, {63 , false , true },
29
+ {61 , true , false }, {62 , true , false }, {63 , true , true },
31
30
}
32
31
// Make sure anything we screw up is restored
33
32
backup := ProtocolVersions
@@ -37,7 +36,7 @@ func TestProtocolCompatibility(t *testing.T) {
37
36
for i , tt := range tests {
38
37
ProtocolVersions = []uint {tt .version }
39
38
40
- pm , err := newTestProtocolManager (tt .mode , 0 , nil , nil )
39
+ pm , err := newTestProtocolManager (tt .fastSync , 0 , nil , nil )
41
40
if pm != nil {
42
41
defer pm .Stop ()
43
42
}
@@ -52,7 +51,7 @@ func TestProtocolCompatibility(t *testing.T) {
52
51
func TestGetBlockHashes61 (t * testing.T ) { testGetBlockHashes (t , 61 ) }
53
52
54
53
func testGetBlockHashes (t * testing.T , protocol int ) {
55
- pm := newTestProtocolManagerMust (t , ArchiveMode , downloader .MaxHashFetch + 15 , nil , nil )
54
+ pm := newTestProtocolManagerMust (t , false , downloader .MaxHashFetch + 15 , nil , nil )
56
55
peer , _ := newTestPeer ("peer" , protocol , pm , true )
57
56
defer peer .close ()
58
57
@@ -95,7 +94,7 @@ func testGetBlockHashes(t *testing.T, protocol int) {
95
94
func TestGetBlockHashesFromNumber61 (t * testing.T ) { testGetBlockHashesFromNumber (t , 61 ) }
96
95
97
96
func testGetBlockHashesFromNumber (t * testing.T , protocol int ) {
98
- pm := newTestProtocolManagerMust (t , ArchiveMode , downloader .MaxHashFetch + 15 , nil , nil )
97
+ pm := newTestProtocolManagerMust (t , false , downloader .MaxHashFetch + 15 , nil , nil )
99
98
peer , _ := newTestPeer ("peer" , protocol , pm , true )
100
99
defer peer .close ()
101
100
@@ -135,7 +134,7 @@ func testGetBlockHashesFromNumber(t *testing.T, protocol int) {
135
134
func TestGetBlocks61 (t * testing.T ) { testGetBlocks (t , 61 ) }
136
135
137
136
func testGetBlocks (t * testing.T , protocol int ) {
138
- pm := newTestProtocolManagerMust (t , ArchiveMode , downloader .MaxHashFetch + 15 , nil , nil )
137
+ pm := newTestProtocolManagerMust (t , false , downloader .MaxHashFetch + 15 , nil , nil )
139
138
peer , _ := newTestPeer ("peer" , protocol , pm , true )
140
139
defer peer .close ()
141
140
@@ -204,10 +203,9 @@ func testGetBlocks(t *testing.T, protocol int) {
204
203
// Tests that block headers can be retrieved from a remote chain based on user queries.
205
204
func TestGetBlockHeaders62 (t * testing.T ) { testGetBlockHeaders (t , 62 ) }
206
205
func TestGetBlockHeaders63 (t * testing.T ) { testGetBlockHeaders (t , 63 ) }
207
- func TestGetBlockHeaders64 (t * testing.T ) { testGetBlockHeaders (t , 64 ) }
208
206
209
207
func testGetBlockHeaders (t * testing.T , protocol int ) {
210
- pm := newTestProtocolManagerMust (t , ArchiveMode , downloader .MaxHashFetch + 15 , nil , nil )
208
+ pm := newTestProtocolManagerMust (t , false , downloader .MaxHashFetch + 15 , nil , nil )
211
209
peer , _ := newTestPeer ("peer" , protocol , pm , true )
212
210
defer peer .close ()
213
211
@@ -330,10 +328,9 @@ func testGetBlockHeaders(t *testing.T, protocol int) {
330
328
// Tests that block contents can be retrieved from a remote chain based on their hashes.
331
329
func TestGetBlockBodies62 (t * testing.T ) { testGetBlockBodies (t , 62 ) }
332
330
func TestGetBlockBodies63 (t * testing.T ) { testGetBlockBodies (t , 63 ) }
333
- func TestGetBlockBodies64 (t * testing.T ) { testGetBlockBodies (t , 64 ) }
334
331
335
332
func testGetBlockBodies (t * testing.T , protocol int ) {
336
- pm := newTestProtocolManagerMust (t , ArchiveMode , downloader .MaxBlockFetch + 15 , nil , nil )
333
+ pm := newTestProtocolManagerMust (t , false , downloader .MaxBlockFetch + 15 , nil , nil )
337
334
peer , _ := newTestPeer ("peer" , protocol , pm , true )
338
335
defer peer .close ()
339
336
@@ -402,7 +399,6 @@ func testGetBlockBodies(t *testing.T, protocol int) {
402
399
403
400
// Tests that the node state database can be retrieved based on hashes.
404
401
func TestGetNodeData63 (t * testing.T ) { testGetNodeData (t , 63 ) }
405
- func TestGetNodeData64 (t * testing.T ) { testGetNodeData (t , 64 ) }
406
402
407
403
func testGetNodeData (t * testing.T , protocol int ) {
408
404
// Define three accounts to simulate transactions with
@@ -440,7 +436,7 @@ func testGetNodeData(t *testing.T, protocol int) {
440
436
}
441
437
}
442
438
// Assemble the test environment
443
- pm := newTestProtocolManagerMust (t , ArchiveMode , 4 , generator , nil )
439
+ pm := newTestProtocolManagerMust (t , false , 4 , generator , nil )
444
440
peer , _ := newTestPeer ("peer" , protocol , pm , true )
445
441
defer peer .close ()
446
442
@@ -492,7 +488,6 @@ func testGetNodeData(t *testing.T, protocol int) {
492
488
493
489
// Tests that the transaction receipts can be retrieved based on hashes.
494
490
func TestGetReceipt63 (t * testing.T ) { testGetReceipt (t , 63 ) }
495
- func TestGetReceipt64 (t * testing.T ) { testGetReceipt (t , 64 ) }
496
491
497
492
func testGetReceipt (t * testing.T , protocol int ) {
498
493
// Define three accounts to simulate transactions with
@@ -530,7 +525,7 @@ func testGetReceipt(t *testing.T, protocol int) {
530
525
}
531
526
}
532
527
// Assemble the test environment
533
- pm := newTestProtocolManagerMust (t , ArchiveMode , 4 , generator , nil )
528
+ pm := newTestProtocolManagerMust (t , false , 4 , generator , nil )
534
529
peer , _ := newTestPeer ("peer" , protocol , pm , true )
535
530
defer peer .close ()
536
531
0 commit comments