github.com/aigarnetwork/aigar@v0.0.0-20191115204914-d59a6eb70f8e/tests/init.go (about) 1 // Copyright 2018 The go-ethereum Authors 2 // Copyright 2019 The go-aigar Authors 3 // This file is part of the go-aigar library. 4 // 5 // The go-aigar library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Lesser General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // The go-aigar library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with the go-aigar library. If not, see <http://www.gnu.org/licenses/>. 17 18 package tests 19 20 import ( 21 "fmt" 22 "math/big" 23 24 "github.com/AigarNetwork/aigar/params" 25 ) 26 27 // Forks table defines supported forks and their chain config. 28 var Forks = map[string]*params.ChainConfig{ 29 "Frontier": { 30 ChainID: big.NewInt(1), 31 }, 32 "Homestead": { 33 ChainID: big.NewInt(1), 34 HomesteadBlock: big.NewInt(0), 35 }, 36 "EIP150": { 37 ChainID: big.NewInt(1), 38 HomesteadBlock: big.NewInt(0), 39 EIP150Block: big.NewInt(0), 40 }, 41 "EIP158": { 42 ChainID: big.NewInt(1), 43 HomesteadBlock: big.NewInt(0), 44 EIP150Block: big.NewInt(0), 45 EIP155Block: big.NewInt(0), 46 EIP158Block: big.NewInt(0), 47 }, 48 "Byzantium": { 49 ChainID: big.NewInt(1), 50 HomesteadBlock: big.NewInt(0), 51 EIP150Block: big.NewInt(0), 52 EIP155Block: big.NewInt(0), 53 EIP158Block: big.NewInt(0), 54 DAOForkBlock: big.NewInt(0), 55 ByzantiumBlock: big.NewInt(0), 56 }, 57 "Constantinople": { 58 ChainID: big.NewInt(1), 59 HomesteadBlock: big.NewInt(0), 60 EIP150Block: big.NewInt(0), 61 EIP155Block: big.NewInt(0), 62 EIP158Block: big.NewInt(0), 63 DAOForkBlock: big.NewInt(0), 64 ByzantiumBlock: big.NewInt(0), 65 ConstantinopleBlock: big.NewInt(0), 66 PetersburgBlock: big.NewInt(10000000), 67 }, 68 "ConstantinopleFix": { 69 ChainID: big.NewInt(1), 70 HomesteadBlock: big.NewInt(0), 71 EIP150Block: big.NewInt(0), 72 EIP155Block: big.NewInt(0), 73 EIP158Block: big.NewInt(0), 74 DAOForkBlock: big.NewInt(0), 75 ByzantiumBlock: big.NewInt(0), 76 ConstantinopleBlock: big.NewInt(0), 77 PetersburgBlock: big.NewInt(0), 78 }, 79 "Istanbul": { 80 ChainID: big.NewInt(1), 81 HomesteadBlock: big.NewInt(0), 82 EIP150Block: big.NewInt(0), 83 EIP155Block: big.NewInt(0), 84 EIP158Block: big.NewInt(0), 85 DAOForkBlock: big.NewInt(0), 86 ByzantiumBlock: big.NewInt(0), 87 ConstantinopleBlock: big.NewInt(0), 88 PetersburgBlock: big.NewInt(0), 89 IstanbulBlock: big.NewInt(0), 90 }, 91 "FrontierToHomesteadAt5": { 92 ChainID: big.NewInt(1), 93 HomesteadBlock: big.NewInt(5), 94 }, 95 "HomesteadToEIP150At5": { 96 ChainID: big.NewInt(1), 97 HomesteadBlock: big.NewInt(0), 98 EIP150Block: big.NewInt(5), 99 }, 100 "HomesteadToDaoAt5": { 101 ChainID: big.NewInt(1), 102 HomesteadBlock: big.NewInt(0), 103 DAOForkBlock: big.NewInt(5), 104 DAOForkSupport: true, 105 }, 106 "EIP158ToByzantiumAt5": { 107 ChainID: big.NewInt(1), 108 HomesteadBlock: big.NewInt(0), 109 EIP150Block: big.NewInt(0), 110 EIP155Block: big.NewInt(0), 111 EIP158Block: big.NewInt(0), 112 ByzantiumBlock: big.NewInt(5), 113 }, 114 "ByzantiumToConstantinopleAt5": { 115 ChainID: big.NewInt(1), 116 HomesteadBlock: big.NewInt(0), 117 EIP150Block: big.NewInt(0), 118 EIP155Block: big.NewInt(0), 119 EIP158Block: big.NewInt(0), 120 ByzantiumBlock: big.NewInt(0), 121 ConstantinopleBlock: big.NewInt(5), 122 }, 123 "ByzantiumToConstantinopleFixAt5": { 124 ChainID: big.NewInt(1), 125 HomesteadBlock: big.NewInt(0), 126 EIP150Block: big.NewInt(0), 127 EIP155Block: big.NewInt(0), 128 EIP158Block: big.NewInt(0), 129 ByzantiumBlock: big.NewInt(0), 130 ConstantinopleBlock: big.NewInt(5), 131 PetersburgBlock: big.NewInt(5), 132 }, 133 "ConstantinopleFixToIstanbulAt5": { 134 ChainID: big.NewInt(1), 135 HomesteadBlock: big.NewInt(0), 136 EIP150Block: big.NewInt(0), 137 EIP155Block: big.NewInt(0), 138 EIP158Block: big.NewInt(0), 139 ByzantiumBlock: big.NewInt(0), 140 ConstantinopleBlock: big.NewInt(0), 141 PetersburgBlock: big.NewInt(0), 142 IstanbulBlock: big.NewInt(5), 143 }, 144 } 145 146 // UnsupportedForkError is returned when a test requests a fork that isn't implemented. 147 type UnsupportedForkError struct { 148 Name string 149 } 150 151 func (e UnsupportedForkError) Error() string { 152 return fmt.Sprintf("unsupported fork %q", e.Name) 153 }