From 8f98d65626586fb3a86666a9770b2fa20df107fa Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 29 Apr 2015 16:23:22 +0200 Subject: [PATCH] Split params into evm-related and mining/block-related. --- libethcore/BlockInfo.cpp | 2 +- libethcore/EthashAux.cpp | 1 - libethcore/Params.cpp | 43 +++++++++++++++++++++++++++++++++ libethcore/Params.h | 42 ++++++++++++++++++++++++++++++++ libethereum/BlockChain.cpp | 1 + libethereum/CanonBlockChain.cpp | 1 + libethereum/Interface.h | 1 - libethereum/State.h | 1 - libevmcore/Params.cpp | 8 ------ libevmcore/Params.h | 8 ------ mix/MixClient.cpp | 1 + 11 files changed, 89 insertions(+), 20 deletions(-) create mode 100644 libethcore/Params.cpp create mode 100644 libethcore/Params.h diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index 24b108ccb..24fc1cb65 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "EthashAux.h" #include "ProofOfWork.h" #include "Exceptions.h" diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 36b6f1bd5..215d50203 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include "BlockInfo.h" using namespace std; using namespace chrono; diff --git a/libethcore/Params.cpp b/libethcore/Params.cpp new file mode 100644 index 000000000..a6107e62b --- /dev/null +++ b/libethcore/Params.cpp @@ -0,0 +1,43 @@ +/* + 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 . +*/ +/** @file Params.cpp + * @author Gav Wood + * @date 2014 + */ + +#include "Params.h" + +using namespace std; +namespace dev +{ +namespace eth +{ + +//--- BEGIN: AUTOGENERATED FROM github.com/ethereum/common/params.json +u256 const c_genesisDifficulty = 131072; +u256 const c_maximumExtraDataSize = 1024; +u256 const c_genesisGasLimit = 3141592; +u256 const c_minGasLimit = 125000; +u256 const c_gasLimitBoundDivisor = 1024; +u256 const c_minimumDifficulty = 131072; +u256 const c_difficultyBoundDivisor = 2048; +u256 const c_durationLimit = 8; +//--- END: AUTOGENERATED FROM /feeStructure.json + +} +} + diff --git a/libethcore/Params.h b/libethcore/Params.h new file mode 100644 index 000000000..3520b2f1b --- /dev/null +++ b/libethcore/Params.h @@ -0,0 +1,42 @@ +/* + 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 . +*/ +/** @file Params.h + * @author Gav Wood + * @date 2014 + */ + +#pragma once + +#include + +namespace dev +{ +namespace eth +{ + +//--- BEGIN: AUTOGENERATED FROM /feeStructure.json +extern u256 const c_genesisGasLimit; +extern u256 const c_minGasLimit; +extern u256 const c_gasLimitBoundDivisor; +extern u256 const c_genesisDifficulty; +extern u256 const c_minimumDifficulty; +extern u256 const c_difficultyBoundDivisor; +extern u256 const c_durationLimit; +extern u256 const c_maximumExtraDataSize; + +} +} diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 2c5e5c01c..eb36fd8e3 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "GenesisInfo.h" #include "State.h" diff --git a/libethereum/CanonBlockChain.cpp b/libethereum/CanonBlockChain.cpp index b5c47b653..2cc1d24dc 100644 --- a/libethereum/CanonBlockChain.cpp +++ b/libethereum/CanonBlockChain.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "GenesisInfo.h" #include "State.h" diff --git a/libethereum/Interface.h b/libethereum/Interface.h index e23a70f4c..ff2c9ad9f 100644 --- a/libethereum/Interface.h +++ b/libethereum/Interface.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "LogFilter.h" #include "Transaction.h" diff --git a/libethereum/State.h b/libethereum/State.h index f71e68eac..e3468c24c 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "TransactionQueue.h" #include "Account.h" diff --git a/libevmcore/Params.cpp b/libevmcore/Params.cpp index d70cfc379..91b50d0f6 100644 --- a/libevmcore/Params.cpp +++ b/libevmcore/Params.cpp @@ -28,14 +28,6 @@ namespace eth { //--- BEGIN: AUTOGENERATED FROM github.com/ethereum/common/params.json -u256 const c_genesisDifficulty = 131072; -u256 const c_maximumExtraDataSize = 1024; -u256 const c_genesisGasLimit = 3141592; -u256 const c_minGasLimit = 125000; -u256 const c_gasLimitBoundDivisor = 1024; -u256 const c_minimumDifficulty = 131072; -u256 const c_difficultyBoundDivisor = 2048; -u256 const c_durationLimit = 8; u256 const c_stackLimit = 1024; u256 const c_tierStepGas[] = {0, 2, 3, 5, 8, 10, 20, 0}; u256 const c_expGas = 10; diff --git a/libevmcore/Params.h b/libevmcore/Params.h index 26f12b37c..213ff5a2d 100644 --- a/libevmcore/Params.h +++ b/libevmcore/Params.h @@ -29,14 +29,6 @@ namespace eth { //--- BEGIN: AUTOGENERATED FROM /feeStructure.json -extern u256 const c_genesisGasLimit; -extern u256 const c_minGasLimit; -extern u256 const c_gasLimitBoundDivisor; -extern u256 const c_genesisDifficulty; -extern u256 const c_minimumDifficulty; -extern u256 const c_difficultyBoundDivisor; -extern u256 const c_durationLimit; -extern u256 const c_maximumExtraDataSize; extern u256 const c_stackLimit; extern u256 const c_tierStepGas[8]; ///< Once per operation, for a selection of them. diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index 3fb325bd4..b1d8f889e 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "Exceptions.h" using namespace std;