init.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. "fmt"
  19. "math/big"
  20. "github.com/ethereum/go-ethereum/params"
  21. )
  22. // Forks table defines supported forks and their chain config.
  23. var Forks = map[string]*params.ChainConfig{
  24. "Frontier": {
  25. ChainID: big.NewInt(1),
  26. },
  27. "Homestead": {
  28. ChainID: big.NewInt(1),
  29. HomesteadBlock: big.NewInt(0),
  30. },
  31. "EIP150": {
  32. ChainID: big.NewInt(1),
  33. HomesteadBlock: big.NewInt(0),
  34. EIP150Block: big.NewInt(0),
  35. },
  36. "EIP158": {
  37. ChainID: big.NewInt(1),
  38. HomesteadBlock: big.NewInt(0),
  39. EIP150Block: big.NewInt(0),
  40. EIP155Block: big.NewInt(0),
  41. EIP158Block: big.NewInt(0),
  42. },
  43. "Byzantium": {
  44. ChainID: big.NewInt(1),
  45. HomesteadBlock: big.NewInt(0),
  46. EIP150Block: big.NewInt(0),
  47. EIP155Block: big.NewInt(0),
  48. EIP158Block: big.NewInt(0),
  49. DAOForkBlock: big.NewInt(0),
  50. ByzantiumBlock: big.NewInt(0),
  51. },
  52. "Constantinople": {
  53. ChainID: big.NewInt(1),
  54. HomesteadBlock: big.NewInt(0),
  55. EIP150Block: big.NewInt(0),
  56. EIP155Block: big.NewInt(0),
  57. EIP158Block: big.NewInt(0),
  58. DAOForkBlock: big.NewInt(0),
  59. ByzantiumBlock: big.NewInt(0),
  60. ConstantinopleBlock: big.NewInt(0),
  61. PetersburgBlock: big.NewInt(10000000),
  62. },
  63. "ConstantinopleFix": {
  64. ChainID: big.NewInt(1),
  65. HomesteadBlock: big.NewInt(0),
  66. EIP150Block: big.NewInt(0),
  67. EIP155Block: big.NewInt(0),
  68. EIP158Block: big.NewInt(0),
  69. DAOForkBlock: big.NewInt(0),
  70. ByzantiumBlock: big.NewInt(0),
  71. ConstantinopleBlock: big.NewInt(0),
  72. PetersburgBlock: big.NewInt(0),
  73. },
  74. "FrontierToHomesteadAt5": {
  75. ChainID: big.NewInt(1),
  76. HomesteadBlock: big.NewInt(5),
  77. },
  78. "HomesteadToEIP150At5": {
  79. ChainID: big.NewInt(1),
  80. HomesteadBlock: big.NewInt(0),
  81. EIP150Block: big.NewInt(5),
  82. },
  83. "HomesteadToDaoAt5": {
  84. ChainID: big.NewInt(1),
  85. HomesteadBlock: big.NewInt(0),
  86. DAOForkBlock: big.NewInt(5),
  87. DAOForkSupport: true,
  88. },
  89. "EIP158ToByzantiumAt5": {
  90. ChainID: big.NewInt(1),
  91. HomesteadBlock: big.NewInt(0),
  92. EIP150Block: big.NewInt(0),
  93. EIP155Block: big.NewInt(0),
  94. EIP158Block: big.NewInt(0),
  95. ByzantiumBlock: big.NewInt(5),
  96. },
  97. "ByzantiumToConstantinopleAt5": {
  98. ChainID: big.NewInt(1),
  99. HomesteadBlock: big.NewInt(0),
  100. EIP150Block: big.NewInt(0),
  101. EIP155Block: big.NewInt(0),
  102. EIP158Block: big.NewInt(0),
  103. ByzantiumBlock: big.NewInt(0),
  104. ConstantinopleBlock: big.NewInt(5),
  105. },
  106. }
  107. // UnsupportedForkError is returned when a test requests a fork that isn't implemented.
  108. type UnsupportedForkError struct {
  109. Name string
  110. }
  111. func (e UnsupportedForkError) Error() string {
  112. return fmt.Sprintf("unsupported fork %q", e.Name)
  113. }