init.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. "FrontierToHomesteadAt5": {
  53. ChainId: big.NewInt(1),
  54. HomesteadBlock: big.NewInt(5),
  55. },
  56. "HomesteadToEIP150At5": {
  57. ChainId: big.NewInt(1),
  58. HomesteadBlock: big.NewInt(0),
  59. EIP150Block: big.NewInt(5),
  60. },
  61. "HomesteadToDaoAt5": {
  62. ChainId: big.NewInt(1),
  63. HomesteadBlock: big.NewInt(0),
  64. DAOForkBlock: big.NewInt(5),
  65. DAOForkSupport: true,
  66. },
  67. "EIP158ToByzantiumAt5": {
  68. ChainId: big.NewInt(1),
  69. HomesteadBlock: big.NewInt(0),
  70. EIP150Block: big.NewInt(0),
  71. EIP155Block: big.NewInt(0),
  72. EIP158Block: big.NewInt(0),
  73. ByzantiumBlock: big.NewInt(5),
  74. },
  75. }
  76. // UnsupportedForkError is returned when a test requests a fork that isn't implemented.
  77. type UnsupportedForkError struct {
  78. Name string
  79. }
  80. func (e UnsupportedForkError) Error() string {
  81. return fmt.Sprintf("unsupported fork %q", e.Name)
  82. }