github.com/jeffallen/go-ethereum@v1.1.4-0.20150910155051-571d3236c49c/tests/block_test.go (about)

     1  // Copyright 2015 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package tests
    18  
    19  import (
    20  	"path/filepath"
    21  	"testing"
    22  )
    23  
    24  func TestBcValidBlockTests(t *testing.T) {
    25  	err := RunBlockTest(filepath.Join(blockTestDir, "bcValidBlockTest.json"), BlockSkipTests)
    26  	if err != nil {
    27  		t.Fatal(err)
    28  	}
    29  }
    30  
    31  func TestBcUncleHeaderValidityTests(t *testing.T) {
    32  	err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleHeaderValiditiy.json"), BlockSkipTests)
    33  	if err != nil {
    34  		t.Fatal(err)
    35  	}
    36  }
    37  
    38  func TestBcUncleTests(t *testing.T) {
    39  	err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleTest.json"), BlockSkipTests)
    40  	if err != nil {
    41  		t.Fatal(err)
    42  	}
    43  }
    44  
    45  func TestBcInvalidHeaderTests(t *testing.T) {
    46  	err := RunBlockTest(filepath.Join(blockTestDir, "bcInvalidHeaderTest.json"), BlockSkipTests)
    47  	if err != nil {
    48  		t.Fatal(err)
    49  	}
    50  }
    51  
    52  func TestBcInvalidRLPTests(t *testing.T) {
    53  	err := RunBlockTest(filepath.Join(blockTestDir, "bcInvalidRLPTest.json"), BlockSkipTests)
    54  	if err != nil {
    55  		t.Fatal(err)
    56  	}
    57  }
    58  
    59  func TestBcRPCAPITests(t *testing.T) {
    60  	err := RunBlockTest(filepath.Join(blockTestDir, "bcRPC_API_Test.json"), BlockSkipTests)
    61  	if err != nil {
    62  		t.Fatal(err)
    63  	}
    64  }
    65  
    66  func TestBcForkBlockTests(t *testing.T) {
    67  	err := RunBlockTest(filepath.Join(blockTestDir, "bcForkBlockTest.json"), BlockSkipTests)
    68  	if err != nil {
    69  		t.Fatal(err)
    70  	}
    71  }
    72  
    73  func TestBcTotalDifficulty(t *testing.T) {
    74  	err := RunBlockTest(filepath.Join(blockTestDir, "bcTotalDifficultyTest.json"), BlockSkipTests)
    75  	if err != nil {
    76  		t.Fatal(err)
    77  	}
    78  }
    79  
    80  func TestBcWallet(t *testing.T) {
    81  	err := RunBlockTest(filepath.Join(blockTestDir, "bcWalletTest.json"), BlockSkipTests)
    82  	if err != nil {
    83  		t.Fatal(err)
    84  	}
    85  }
    86  
    87  func TestBcGasPricer(t *testing.T) {
    88  	err := RunBlockTest(filepath.Join(blockTestDir, "bcGasPricerTest.json"), BlockSkipTests)
    89  	if err != nil {
    90  		t.Fatal(err)
    91  	}
    92  }
    93  
    94  // TODO: iterate over files once we got more than a few
    95  func TestBcRandom(t *testing.T) {
    96  	err := RunBlockTest(filepath.Join(blockTestDir, "RandomTests/bl201507071825GO.json"), BlockSkipTests)
    97  	if err != nil {
    98  		t.Fatal(err)
    99  	}
   100  }