github.com/codingfuture/orig-energi3@v0.8.4/tests/init.go (about)

     1  // Copyright 2018 The Energi Core Authors
     2  // Copyright 2015 The go-ethereum Authors
     3  // This file is part of the Energi Core library.
     4  //
     5  // The Energi Core 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 Energi Core 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 Energi Core 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/ethereum/go-ethereum/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  		ByzantiumBlock: big.NewInt(0),
    55  	},
    56  	"Constantinople": {
    57  		ChainID:             big.NewInt(1),
    58  		HomesteadBlock:      big.NewInt(0),
    59  		EIP150Block:         big.NewInt(0),
    60  		EIP155Block:         big.NewInt(0),
    61  		EIP158Block:         big.NewInt(0),
    62  		ByzantiumBlock:      big.NewInt(0),
    63  		ConstantinopleBlock: big.NewInt(0),
    64  		PetersburgBlock:     big.NewInt(10000000),
    65  	},
    66  	"ConstantinopleFix": {
    67  		ChainID:             big.NewInt(1),
    68  		HomesteadBlock:      big.NewInt(0),
    69  		EIP150Block:         big.NewInt(0),
    70  		EIP155Block:         big.NewInt(0),
    71  		EIP158Block:         big.NewInt(0),
    72  		ByzantiumBlock:      big.NewInt(0),
    73  		ConstantinopleBlock: big.NewInt(0),
    74  		PetersburgBlock:     big.NewInt(0),
    75  	},
    76  	"FrontierToHomesteadAt5": {
    77  		ChainID:        big.NewInt(1),
    78  		HomesteadBlock: big.NewInt(5),
    79  	},
    80  	"HomesteadToEIP150At5": {
    81  		ChainID:        big.NewInt(1),
    82  		HomesteadBlock: big.NewInt(0),
    83  		EIP150Block:    big.NewInt(5),
    84  	},
    85  	"EIP158ToByzantiumAt5": {
    86  		ChainID:        big.NewInt(1),
    87  		HomesteadBlock: big.NewInt(0),
    88  		EIP150Block:    big.NewInt(0),
    89  		EIP155Block:    big.NewInt(0),
    90  		EIP158Block:    big.NewInt(0),
    91  		ByzantiumBlock: big.NewInt(5),
    92  	},
    93  	"ByzantiumToConstantinopleAt5": {
    94  		ChainID:             big.NewInt(1),
    95  		HomesteadBlock:      big.NewInt(0),
    96  		EIP150Block:         big.NewInt(0),
    97  		EIP155Block:         big.NewInt(0),
    98  		EIP158Block:         big.NewInt(0),
    99  		ByzantiumBlock:      big.NewInt(0),
   100  		ConstantinopleBlock: big.NewInt(5),
   101  	},
   102  }
   103  
   104  // UnsupportedForkError is returned when a test requests a fork that isn't implemented.
   105  type UnsupportedForkError struct {
   106  	Name string
   107  }
   108  
   109  func (e UnsupportedForkError) Error() string {
   110  	return fmt.Sprintf("unsupported fork %q", e.Name)
   111  }