Fabcoin Core  0.16.2
P2P Digital Currency
GenesisInfo.cpp
Go to the documentation of this file.
1 
2 /*
3  This file is part of cpp-ethereum.
4 
5  cpp-ethereum is free software: you can redistribute it and/or modify
6  it under the terms of the GNU 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  cpp-ethereum 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 General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "GenesisInfo.h"
20 using namespace dev;
21 
22 //Client configurations
23 #include "genesis/mainNetwork.cpp"
24 #include "genesis/ropsten.cpp"
25 
26 //Test configurations
28 #include "genesis/frontierTest.cpp"
30 #include "genesis/eip150Test.cpp"
31 #include "genesis/eip158Test.cpp"
36 
37 std::string const& dev::eth::genesisInfo(Network _n)
38 {
39  switch (_n)
40  {
41  case Network::MainNetwork: return c_genesisInfoMainNetwork;
42  case Network::MainNetworkTest: return c_genesisInfoMainNetworkTest;
43  case Network::Ropsten: return c_genesisInfoRopsten;
44  case Network::TransitionnetTest: return c_genesisInfoTest;
45  case Network::FrontierTest: return c_genesisInfoFrontierTest;
46  case Network::HomesteadTest: return c_genesisInfoHomesteadTest;
47  case Network::EIP150Test: return c_genesisInfoEIP150Test;
48  case Network::EIP158Test: return c_genesisInfoEIP158Test;
49  case Network::MetropolisTest: return c_genesisInfoMetropolisTest;
50  case Network::fascMainNetwork: return c_genesisInfoFascMainNetwork;
51  case Network::fascTestNetwork: return c_genesisInfoFascTestNetwork;
52  default:
53  throw std::invalid_argument("Invalid network value");
54  }
55 }
56 
58 {
59  switch (_n)
60  {
61  case Network::MainNetwork: return c_genesisStateRootMainNetwork;
62  case Network::Ropsten: return c_genesisStateRootRopsten;
63  case Network::MainNetworkTest: return c_genesisStateRootMainNetworkTest;
64  case Network::TransitionnetTest: return c_genesisStateRootTest;
65  case Network::FrontierTest: return c_genesisStateRootFrontierTest;
66  case Network::HomesteadTest: return c_genesisStateRootHomesteadTest;
67  case Network::EIP150Test: return c_genesisStateRootEIP150Test;
68  case Network::EIP158Test: return c_genesisStateRootEIP158Test;
69  case Network::MetropolisTest: return c_genesisStateRootMetropolisTest;
70  case Network::fascMainNetwork: return c_genesisStateRootFascMainNetwork;
71  case Network::fascTestNetwork: return c_genesisStateRootFascTestNetwork;
72  default:
73  throw std::invalid_argument("Invalid network value");
74  }
75 }
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
Network
The network id.
Definition: GenesisInfo.h:34
h256 const & genesisStateRoot(Network _n)
Definition: GenesisInfo.cpp:57
std::string const & genesisInfo(Network _n)
Definition: GenesisInfo.cpp:37