block_test.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Copyright 2015 The go-ethereum Authors
  2. // This file is part of go-ethereum.
  3. //
  4. // go-ethereum 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. // go-ethereum 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 go-ethereum. 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 TestBcUncleTests(t *testing.T) {
  28. err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleTest.json"), BlockSkipTests)
  29. if err != nil {
  30. t.Fatal(err)
  31. }
  32. err = RunBlockTest(filepath.Join(blockTestDir, "bcBruncleTest.json"), BlockSkipTests)
  33. if err != nil {
  34. t.Fatal(err)
  35. }
  36. }
  37. func TestBcUncleHeaderValidityTests(t *testing.T) {
  38. err := RunBlockTest(filepath.Join(blockTestDir, "bcUncleHeaderValiditiy.json"), BlockSkipTests)
  39. if err != nil {
  40. t.Fatal(err)
  41. }
  42. }
  43. func TestBcInvalidHeaderTests(t *testing.T) {
  44. err := RunBlockTest(filepath.Join(blockTestDir, "bcInvalidHeaderTest.json"), BlockSkipTests)
  45. if err != nil {
  46. t.Fatal(err)
  47. }
  48. }
  49. func TestBcInvalidRLPTests(t *testing.T) {
  50. err := RunBlockTest(filepath.Join(blockTestDir, "bcInvalidRLPTest.json"), BlockSkipTests)
  51. if err != nil {
  52. t.Fatal(err)
  53. }
  54. }
  55. func TestBcRPCAPITests(t *testing.T) {
  56. err := RunBlockTest(filepath.Join(blockTestDir, "bcRPC_API_Test.json"), BlockSkipTests)
  57. if err != nil {
  58. t.Fatal(err)
  59. }
  60. }
  61. func TestBcForkBlockTests(t *testing.T) {
  62. err := RunBlockTest(filepath.Join(blockTestDir, "bcForkBlockTest.json"), BlockSkipTests)
  63. if err != nil {
  64. t.Fatal(err)
  65. }
  66. }
  67. func TestBcTotalDifficulty(t *testing.T) {
  68. err := RunBlockTest(filepath.Join(blockTestDir, "bcTotalDifficultyTest.json"), BlockSkipTests)
  69. if err != nil {
  70. t.Fatal(err)
  71. }
  72. }
  73. func TestBcWallet(t *testing.T) {
  74. err := RunBlockTest(filepath.Join(blockTestDir, "bcWalletTest.json"), BlockSkipTests)
  75. if err != nil {
  76. t.Fatal(err)
  77. }
  78. }
  79. func TestBcGasPricer(t *testing.T) {
  80. err := RunBlockTest(filepath.Join(blockTestDir, "bcGasPricerTest.json"), BlockSkipTests)
  81. if err != nil {
  82. t.Fatal(err)
  83. }
  84. }