block_test.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. package tests
  17. import (
  18. "path/filepath"
  19. "testing"
  20. )
  21. func TestBcValidBlockTests(t *testing.T) {
  22. err := RunBlockTest(filepath.Join(blockTestDir, "bcValidBlockTest.json"), BlockSkipTests)
  23. if err != nil {
  24. t.Fatal(err)
  25. }
  26. }
  27. func TestBcUncleHeaderValidityTests(t *testing.T) {
  28. err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleHeaderValiditiy.json"), BlockSkipTests)
  29. if err != nil {
  30. t.Fatal(err)
  31. }
  32. }
  33. func TestBcUncleTests(t *testing.T) {
  34. err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleTest.json"), BlockSkipTests)
  35. if err != nil {
  36. t.Fatal(err)
  37. }
  38. }
  39. func TestBcForkUncleTests(t *testing.T) {
  40. err := RunBlockTest(filepath.Join(blockTestDir, "bcForkUncle.json"), BlockSkipTests)
  41. if err != nil {
  42. t.Fatal(err)
  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. func TestBcInvalidRLPTests(t *testing.T) {
  52. err := RunBlockTest(filepath.Join(blockTestDir, "bcInvalidRLPTest.json"), BlockSkipTests)
  53. if err != nil {
  54. t.Fatal(err)
  55. }
  56. }
  57. func TestBcRPCAPITests(t *testing.T) {
  58. err := RunBlockTest(filepath.Join(blockTestDir, "bcRPC_API_Test.json"), BlockSkipTests)
  59. if err != nil {
  60. t.Fatal(err)
  61. }
  62. }
  63. func TestBcForkBlockTests(t *testing.T) {
  64. err := RunBlockTest(filepath.Join(blockTestDir, "bcForkBlockTest.json"), BlockSkipTests)
  65. if err != nil {
  66. t.Fatal(err)
  67. }
  68. }
  69. func TestBcTotalDifficulty(t *testing.T) {
  70. err := RunBlockTest(filepath.Join(blockTestDir, "bcTotalDifficultyTest.json"), BlockSkipTests)
  71. if err != nil {
  72. t.Fatal(err)
  73. }
  74. }
  75. func TestBcWallet(t *testing.T) {
  76. err := RunBlockTest(filepath.Join(blockTestDir, "bcWalletTest.json"), BlockSkipTests)
  77. if err != nil {
  78. t.Fatal(err)
  79. }
  80. }
  81. func TestBcGasPricer(t *testing.T) {
  82. err := RunBlockTest(filepath.Join(blockTestDir, "bcGasPricerTest.json"), BlockSkipTests)
  83. if err != nil {
  84. t.Fatal(err)
  85. }
  86. }
  87. // TODO: iterate over files once we got more than a few
  88. func TestBcRandom(t *testing.T) {
  89. err := RunBlockTest(filepath.Join(blockTestDir, "RandomTests/bl201507071825GO.json"), BlockSkipTests)
  90. if err != nil {
  91. t.Fatal(err)
  92. }
  93. }