-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenesisInfo.cpp
100 lines (86 loc) · 3.65 KB
/
GenesisInfo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
This file is part of cpp-ethereum.
cpp-ethereum is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
cpp-ethereum is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GenesisInfo.h"
using namespace dev;
//Client configurations
#include "genesis/mainNetwork.cpp"
#include "genesis/ropsten.cpp"
//Test configurations
#include "genesis/test/mainNetworkTest.cpp"
#include "genesis/test/mainNetworkNoProofTest.cpp"
#include "genesis/test/frontierNoProofTest.cpp"
#include "genesis/test/frontierTest.cpp"
#include "genesis/test/homesteadTest.cpp"
#include "genesis/test/eip150Test.cpp"
#include "genesis/test/eip158Test.cpp"
#include "genesis/test/byzantiumTest.cpp"
#include "genesis/test/byzantiumTransitionTest.cpp"
#include "genesis/test/constantinopleTest.cpp"
#include "genesis/test/constantinopleTransitionTest.cpp"
//Transition configurations
#include "genesis/test/frontierToHomesteadAt5Test.cpp"
#include "genesis/test/homesteadToDaoAt5Test.cpp"
#include "genesis/test/homesteadToEIP150At5Test.cpp"
#include "genesis/test/EIP158ToByzantiumAt5Test.cpp"
#include "genesis/test/transitionnetTest.cpp"
static dev::h256 const c_genesisDefaultStateRoot;
std::string const& dev::eth::genesisInfo(Network _n)
{
switch (_n)
{
//Client genesis
case Network::MainNetwork: return c_genesisInfoMainNetwork;
case Network::Ropsten: return c_genesisInfoRopsten;
//Test genesis
case Network::MainNetworkTest: return c_genesisInfoMainNetworkTest;
case Network::MainNetworkNoProofTest: return c_genesisInfoMainNetworkNoProofTest;
case Network::FrontierNoProofTest: return c_genesisInfoFrontierNoProofTest;
case Network::FrontierTest: return c_genesisInfoFrontierTest;
case Network::HomesteadTest: return c_genesisInfoHomesteadTest;
case Network::EIP150Test: return c_genesisInfoEIP150Test;
case Network::EIP158Test: return c_genesisInfoEIP158Test;
case Network::ByzantiumTest: return c_genesisInfoByzantiumTest;
case Network::ByzantiumTransitionTest: return c_genesisInfoByzantiumTransitionTest;
case Network::ConstantinopleTest: return c_genesisInfoConstantinopleTest;
case Network::ConstantinopleTransitionTest: return c_genesisInfoConstantinopleTransitionTest;
//Transition test genesis
case Network::FrontierToHomesteadAt5: return c_genesisInfoFrontierToHomesteadAt5Test;
case Network::HomesteadToDaoAt5: return c_genesisInfoHomesteadToDaoAt5Test;
case Network::HomesteadToEIP150At5: return c_genesisInfoHomesteadToEIP150At5Test;
case Network::EIP158ToByzantiumAt5: return c_genesisInfoEIP158ToByzantiumAt5Test;
case Network::TransitionnetTest: return c_genesisInfoTest;
default:
throw std::invalid_argument("Invalid network value");
}
}
h256 const& dev::eth::genesisStateRoot(Network _n)
{
switch (_n)
{
case Network::MainNetwork: return c_genesisStateRootMainNetwork;
case Network::Ropsten:
case Network::MainNetworkTest:
case Network::TransitionnetTest:
case Network::FrontierTest:
case Network::HomesteadTest: \
case Network::EIP150Test:
case Network::EIP158Test:
case Network::ByzantiumTest:
case Network::ConstantinopleTest:
case Network::ConstantinopleTransitionTest:
return c_genesisDefaultStateRoot;
default:
throw std::invalid_argument("Invalid network value");
}
}