@@ -22,12 +22,11 @@ func TestProtocolCompatibility(t *testing.T) {
2222 // Define the compatibility chart
2323 tests := []struct {
2424 version uint
25- mode Mode
25+ fastSync bool
2626 compatible bool
2727 }{
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 },
3130 }
3231 // Make sure anything we screw up is restored
3332 backup := ProtocolVersions
@@ -37,7 +36,7 @@ func TestProtocolCompatibility(t *testing.T) {
3736 for i , tt := range tests {
3837 ProtocolVersions = []uint {tt .version }
3938
40- pm , err := newTestProtocolManager (tt .mode , 0 , nil , nil )
39+ pm , err := newTestProtocolManager (tt .fastSync , 0 , nil , nil )
4140 if pm != nil {
4241 defer pm .Stop ()
4342 }
@@ -52,7 +51,7 @@ func TestProtocolCompatibility(t *testing.T) {
5251func TestGetBlockHashes61 (t * testing.T ) { testGetBlockHashes (t , 61 ) }
5352
5453func 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 )
5655 peer , _ := newTestPeer ("peer" , protocol , pm , true )
5756 defer peer .close ()
5857
@@ -95,7 +94,7 @@ func testGetBlockHashes(t *testing.T, protocol int) {
9594func TestGetBlockHashesFromNumber61 (t * testing.T ) { testGetBlockHashesFromNumber (t , 61 ) }
9695
9796func 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 )
9998 peer , _ := newTestPeer ("peer" , protocol , pm , true )
10099 defer peer .close ()
101100
@@ -135,7 +134,7 @@ func testGetBlockHashesFromNumber(t *testing.T, protocol int) {
135134func TestGetBlocks61 (t * testing.T ) { testGetBlocks (t , 61 ) }
136135
137136func 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 )
139138 peer , _ := newTestPeer ("peer" , protocol , pm , true )
140139 defer peer .close ()
141140
@@ -204,10 +203,9 @@ func testGetBlocks(t *testing.T, protocol int) {
204203// Tests that block headers can be retrieved from a remote chain based on user queries.
205204func TestGetBlockHeaders62 (t * testing.T ) { testGetBlockHeaders (t , 62 ) }
206205func TestGetBlockHeaders63 (t * testing.T ) { testGetBlockHeaders (t , 63 ) }
207- func TestGetBlockHeaders64 (t * testing.T ) { testGetBlockHeaders (t , 64 ) }
208206
209207func 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 )
211209 peer , _ := newTestPeer ("peer" , protocol , pm , true )
212210 defer peer .close ()
213211
@@ -330,10 +328,9 @@ func testGetBlockHeaders(t *testing.T, protocol int) {
330328// Tests that block contents can be retrieved from a remote chain based on their hashes.
331329func TestGetBlockBodies62 (t * testing.T ) { testGetBlockBodies (t , 62 ) }
332330func TestGetBlockBodies63 (t * testing.T ) { testGetBlockBodies (t , 63 ) }
333- func TestGetBlockBodies64 (t * testing.T ) { testGetBlockBodies (t , 64 ) }
334331
335332func 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 )
337334 peer , _ := newTestPeer ("peer" , protocol , pm , true )
338335 defer peer .close ()
339336
@@ -402,7 +399,6 @@ func testGetBlockBodies(t *testing.T, protocol int) {
402399
403400// Tests that the node state database can be retrieved based on hashes.
404401func TestGetNodeData63 (t * testing.T ) { testGetNodeData (t , 63 ) }
405- func TestGetNodeData64 (t * testing.T ) { testGetNodeData (t , 64 ) }
406402
407403func testGetNodeData (t * testing.T , protocol int ) {
408404 // Define three accounts to simulate transactions with
@@ -440,7 +436,7 @@ func testGetNodeData(t *testing.T, protocol int) {
440436 }
441437 }
442438 // Assemble the test environment
443- pm := newTestProtocolManagerMust (t , ArchiveMode , 4 , generator , nil )
439+ pm := newTestProtocolManagerMust (t , false , 4 , generator , nil )
444440 peer , _ := newTestPeer ("peer" , protocol , pm , true )
445441 defer peer .close ()
446442
@@ -492,7 +488,6 @@ func testGetNodeData(t *testing.T, protocol int) {
492488
493489// Tests that the transaction receipts can be retrieved based on hashes.
494490func TestGetReceipt63 (t * testing.T ) { testGetReceipt (t , 63 ) }
495- func TestGetReceipt64 (t * testing.T ) { testGetReceipt (t , 64 ) }
496491
497492func testGetReceipt (t * testing.T , protocol int ) {
498493 // Define three accounts to simulate transactions with
@@ -530,7 +525,7 @@ func testGetReceipt(t *testing.T, protocol int) {
530525 }
531526 }
532527 // Assemble the test environment
533- pm := newTestProtocolManagerMust (t , ArchiveMode , 4 , generator , nil )
528+ pm := newTestProtocolManagerMust (t , false , 4 , generator , nil )
534529 peer , _ := newTestPeer ("peer" , protocol , pm , true )
535530 defer peer .close ()
536531
0 commit comments