2017-10-31 15:24:11 -07:00
|
|
|
// Copyright 2017 The go-ethereum Authors
|
2015-07-22 09:48:40 -07:00
|
|
|
// This file is part of the go-ethereum library.
|
2015-07-06 17:54:22 -07:00
|
|
|
//
|
2015-07-23 09:35:11 -07:00
|
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
2015-07-06 17:54:22 -07:00
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
2015-07-22 09:48:40 -07:00
|
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
2015-07-06 17:54:22 -07:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-07-22 09:48:40 -07:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2015-07-06 17:54:22 -07:00
|
|
|
// GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
2015-07-22 09:48:40 -07:00
|
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
2015-07-06 17:54:22 -07:00
|
|
|
|
2015-06-10 10:00:54 -07:00
|
|
|
package tests
|
2014-10-18 14:20:25 -07:00
|
|
|
|
|
|
|
import (
|
2015-06-10 15:11:30 -07:00
|
|
|
"fmt"
|
2017-10-31 15:24:11 -07:00
|
|
|
"math/big"
|
2016-01-12 02:54:29 -08:00
|
|
|
|
2017-10-31 15:24:11 -07:00
|
|
|
"github.com/ethereum/go-ethereum/params"
|
2015-06-10 13:29:42 -07:00
|
|
|
)
|
2015-06-10 10:00:54 -07:00
|
|
|
|
2017-10-31 15:24:11 -07:00
|
|
|
// This table defines supported forks and their chain config.
|
|
|
|
var Forks = map[string]*params.ChainConfig{
|
|
|
|
"Frontier": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
},
|
|
|
|
"Homestead": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
},
|
|
|
|
"EIP150": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
EIP150Block: big.NewInt(0),
|
|
|
|
},
|
|
|
|
"EIP158": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
EIP150Block: big.NewInt(0),
|
|
|
|
EIP155Block: big.NewInt(0),
|
|
|
|
EIP158Block: big.NewInt(0),
|
|
|
|
},
|
|
|
|
"Byzantium": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
EIP150Block: big.NewInt(0),
|
|
|
|
EIP155Block: big.NewInt(0),
|
|
|
|
EIP158Block: big.NewInt(0),
|
|
|
|
DAOForkBlock: big.NewInt(0),
|
|
|
|
ByzantiumBlock: big.NewInt(0),
|
|
|
|
},
|
|
|
|
"FrontierToHomesteadAt5": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(5),
|
|
|
|
},
|
|
|
|
"HomesteadToEIP150At5": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
EIP150Block: big.NewInt(5),
|
|
|
|
},
|
|
|
|
"HomesteadToDaoAt5": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
DAOForkBlock: big.NewInt(5),
|
|
|
|
DAOForkSupport: true,
|
|
|
|
},
|
|
|
|
"EIP158ToByzantiumAt5": ¶ms.ChainConfig{
|
|
|
|
ChainId: big.NewInt(1),
|
|
|
|
HomesteadBlock: big.NewInt(0),
|
|
|
|
EIP150Block: big.NewInt(0),
|
|
|
|
EIP155Block: big.NewInt(0),
|
|
|
|
EIP158Block: big.NewInt(0),
|
|
|
|
ByzantiumBlock: big.NewInt(5),
|
|
|
|
},
|
2017-02-07 01:59:18 -08:00
|
|
|
}
|
|
|
|
|
2017-10-31 15:24:11 -07:00
|
|
|
// UnsupportedForkError is returned when a test requests a fork that isn't implemented.
|
|
|
|
type UnsupportedForkError struct {
|
|
|
|
Name string
|
2015-06-10 13:10:33 -07:00
|
|
|
}
|
2015-06-14 14:55:03 -07:00
|
|
|
|
2017-10-31 15:24:11 -07:00
|
|
|
func (e UnsupportedForkError) Error() string {
|
|
|
|
return fmt.Sprintf("unsupported fork %q", e.Name)
|
2015-06-14 14:55:03 -07:00
|
|
|
}
|