package test.ethereum.jsontestsuite;

import org.ethereum.jsontestsuite.JSONReader;
import org.json.simple.parser.ParseException;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runners.MethodSorters;

import java.io.IOException;

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class GitHubBlockTest {

    //SHACOMMIT of tested commit, ethereum/tests.git
    public String shacommit = "473f67fcb9f6d3551e4a2db82b84a66c19fe90d5";

    @Ignore
    @Test
    public void runSingleTest() throws ParseException, IOException {
        String json = JSONReader.loadJSONFromCommit("BlockTests/bcUncleTest.json", shacommit);
        GitHubJSONTestSuite.runGitHubJsonSingleBlockTest(json, "oneUncleGeneration7");
    }


    @Ignore
    @Test
    public void runBCBlockChainTest() throws ParseException, IOException {
        String json = JSONReader.loadJSONFromCommit("BlockTests/bcInvalidHeaderTest.json", shacommit);
        GitHubJSONTestSuite.runGitHubJsonBlockTest(json);
    }

    @Ignore
    @Test
    public void runBCInvalidRLPTest() throws ParseException, IOException {
        String json = JSONReader.loadJSONFromCommit("BlockTests/bcInvalidRLPTest.json", shacommit);
        GitHubJSONTestSuite.runGitHubJsonBlockTest(json);
    }

    @Ignore
    @Test
    public void runBCJSAPITest() throws ParseException, IOException {
        String json = JSONReader.loadJSONFromCommit("BlockTests/bcJS_API_Test.json", shacommit);
        GitHubJSONTestSuite.runGitHubJsonBlockTest(json);
    }


    @Ignore
    @Test
    public void runBCUncleTest() throws ParseException, IOException {
        String json = JSONReader.loadJSONFromCommit("BlockTests/bcUncleTest.json", shacommit);
        GitHubJSONTestSuite.runGitHubJsonBlockTest(json);
    }

    @Ignore
    @Test
    public void runBCValidBlockTest() throws ParseException, IOException {
        String json = JSONReader.loadJSONFromCommit("BlockTests/bcValidBlockTest.json", shacommit);
        GitHubJSONTestSuite.runGitHubJsonBlockTest(json);
    }



}

@@ -272,16 +272,64 @@
 ception;
+%0Aimport java.util.Set;%0Aimport java.util.HashSet;
 %0A%0A@FixMe
@@ -488,48 +488,48 @@
  = %22
-473f67fcb9f6d3551e4a2db82b84a66c19fe90d5
+65112b9c04d4f97136b2fd238e6688610a98aabf
 %22;%0A%0A
@@ -805,32 +805,34 @@
 %22);%0A    %7D%0A%0A%0A    
+//
 @Ignore%0A    @Tes
@@ -900,32 +900,80 @@
 , IOException %7B%0A
+        Set%3CString%3E excluded = new HashSet%3C%3E();%0A
         String j
@@ -1071,55 +1071,347 @@
     
-GitHubJSONTestSuite.runGitHubJsonBlockTest(json
+excluded.add(%22wrongNumber%22);%0A        excluded.add(%22wrongDifficulty%22);%0A        excluded.add(%22wrongTimestamp%22);%0A        excluded.add(%22wrongGasLimit%22);%0A        excluded.add(%22wrongParentHash%22);%0A        GitHubJSONTestSuite.runGitHubJsonBlockTest(json,excluded);%0A        //GitHubJSONTestSuite.runGitHubJsonSingleBlockTest(json, %22wrongDifficulty%22
 );%0A 
@@ -1505,32 +1505,80 @@
 , IOException %7B%0A
+        Set%3CString%3E excluded = new HashSet%3C%3E();%0A
         String j
@@ -1653,32 +1653,237 @@
 n%22, shacommit);%0A
+        excluded.add(%22BLOCK_stateRoot_GivenAsList%22);%0A        excluded.add(%22BLOCK_difficulty_GivenAsList%22);%0A        excluded.add(%22BLOCK_mixHash_TooShort%22);%0A        excluded.add(%22BLOCK__RandomByteAtRLP_8%22);%0A
         GitHubJS
@@ -1913,32 +1913,42 @@
 onBlockTest(json
+, excluded
 );%0A    %7D%0A%0A    @I
@@ -2214,32 +2214,33 @@
 e%0A    @Test%0A    
+ 
 public void runB
@@ -2281,32 +2281,80 @@
 , IOException %7B%0A
+        Set%3CString%3E excluded = new HashSet%3C%3E();%0A
         String j
@@ -2424,32 +2424,585 @@
 n%22, shacommit);%0A
+        excluded.add(%22uncleWithSameBlockNumber%22);%0A        excluded.add(%22uncleHeaderWithGeneration0%22);%0A        excluded.add(%22oneUncleGeneration2%22);%0A        excluded.add(%22oneUncleGeneration3%22);%0A        excluded.add(%22oneUncleGeneration4%22);%0A        excluded.add(%22oneUncleGeneration5%22);%0A        excluded.add(%22oneUncleGeneration6%22);%0A        excluded.add(%22oneUncleGeneration7%22);%0A        excluded.add(%22InChainUncle%22);%0A        excluded.add(%22oneUncle%22);%0A        excluded.add(%22twoUncle%22);%0A        excluded.add(%22threeUncle%22);%0A        excluded.add(%22twoEqualUncle%22);%0A
         GitHubJS
@@ -3032,32 +3032,42 @@
 onBlockTest(json
+, excluded
 );%0A    %7D%0A%0A    @I

Bump hash and start using excluded in block tests