quorum/tests/init.go

89 lines
2.5 KiB
Go
Raw Normal View History

2018-05-23 22:32:26 -07:00
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
2015-07-06 17:54:22 -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.
//
// 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
// 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
// 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"
"math/big"
"github.com/ethereum/go-ethereum/params"
2015-06-10 13:29:42 -07:00
)
2015-06-10 10:00:54 -07:00
2018-05-23 22:32:26 -07:00
// Forks table defines supported forks and their chain config.
var Forks = map[string]*params.ChainConfig{
2018-05-23 22:32:26 -07:00
"Frontier": {
ChainId: big.NewInt(1),
},
2018-05-23 22:32:26 -07:00
"Homestead": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
},
2018-05-23 22:32:26 -07:00
"EIP150": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
},
2018-05-23 22:32:26 -07:00
"EIP158": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
},
2018-05-23 22:32:26 -07:00
"Byzantium": {
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),
},
2018-05-23 22:32:26 -07:00
"FrontierToHomesteadAt5": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(5),
},
2018-05-23 22:32:26 -07:00
"HomesteadToEIP150At5": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(5),
},
2018-05-23 22:32:26 -07:00
"HomesteadToDaoAt5": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: big.NewInt(5),
DAOForkSupport: true,
},
2018-05-23 22:32:26 -07:00
"EIP158ToByzantiumAt5": {
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(5),
},
}
// UnsupportedForkError is returned when a test requests a fork that isn't implemented.
type UnsupportedForkError struct {
Name string
}
2015-06-14 14:55:03 -07:00
func (e UnsupportedForkError) Error() string {
return fmt.Sprintf("unsupported fork %q", e.Name)
2015-06-14 14:55:03 -07:00
}