Browse Source

Remove ethcore/Common.h header

cl-refactor
Paweł Bylica 8 years ago
parent
commit
5c341235a6
No known key found for this signature in database GPG Key ID: 7A0C037434FE77EF
  1. 1
      libethcore/BlockInfo.cpp
  2. 11
      libethcore/BlockInfo.h
  3. 66
      libethcore/Common.h
  4. 1
      libethcore/Exceptions.h
  5. 1
      libethcore/Farm.h
  6. 9
      libethcore/Miner.h

1
libethcore/BlockInfo.cpp

@ -22,7 +22,6 @@
#include <libdevcore/Common.h>
#include <libdevcore/Log.h>
#include <libdevcore/RLP.h>
#include <libethcore/Common.h>
#include "EthashAux.h"
#include "Exceptions.h"
#include "BlockInfo.h"

11
libethcore/BlockInfo.h

@ -24,7 +24,6 @@
#include <libdevcore/Common.h>
#include <libdevcore/RLP.h>
#include <libdevcore/SHA3.h>
#include "Common.h"
#include "Exceptions.h"
namespace dev
@ -32,6 +31,16 @@ namespace dev
namespace eth
{
/// An Ethereum address: 20 bytes.
using Address = h160;
/// The log bloom's size (2048-bit).
using LogBloom = h2048;
using Nonce = h64;
using BlockNumber = unsigned;
enum IncludeProof
{
WithoutProof = 0,

66
libethcore/Common.h

@ -1,66 +0,0 @@
/*
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/>.
*/
/** @file Common.h
* @author Gav Wood <i@gavwood.com>
* @date 2014
*
* Ethereum-specific data structures & algorithms.
*/
#pragma once
#include <string>
#include <functional>
#include <libdevcore/Common.h>
#include <libdevcore/Exceptions.h>
#include <libdevcore/FixedHash.h>
namespace dev
{
namespace eth
{
/// An Ethereum address: 20 bytes.
/// @NOTE This is not endian-specific; it's just a bunch of bytes.
using Address = h160;
DEV_SIMPLE_EXCEPTION(InvalidAddress);
/// The log bloom's size (2048-bit).
using LogBloom = h2048;
/// Many log blooms.
using LogBlooms = std::vector<LogBloom>;
using Nonce = h64;
using BlockNumber = unsigned;
// TODO: move back into a mining subsystem and have it be accessible from Sealant only via a dynamic_cast.
/**
* @brief Describes the progress of a mining operation.
*/
struct WorkingProgress
{
// MiningProgress& operator+=(MiningProgress const& _mp) { hashes += _mp.hashes; ms = std::max(ms, _mp.ms); return *this; }
uint64_t hashes = 0; ///< Total number of hashes computed.
uint64_t ms = 0; ///< Total number of milliseconds of mining thus far.
uint64_t rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; }
};
}
}

1
libethcore/Exceptions.h

@ -22,7 +22,6 @@
#pragma once
#include <libdevcore/Exceptions.h>
#include "Common.h"
namespace dev
{

1
libethcore/Farm.h

@ -26,7 +26,6 @@
#include <atomic>
#include <libdevcore/Common.h>
#include <libdevcore/Worker.h>
#include <libethcore/Common.h>
#include <libethcore/Miner.h>
#include <libethcore/BlockInfo.h>

9
libethcore/Miner.h

@ -29,7 +29,6 @@
#include <libdevcore/Common.h>
#include <libdevcore/Log.h>
#include <libdevcore/Worker.h>
#include <libethcore/Common.h>
#include "EthashAux.h"
#define MINER_WAIT_STATE_UNKNOWN 0
@ -68,6 +67,14 @@ enum class MinerType
Mixed
};
/// Describes the progress of a mining operation.
struct WorkingProgress
{
uint64_t hashes = 0; ///< Total number of hashes computed.
uint64_t ms = 0; ///< Total number of milliseconds of mining thus far.
uint64_t rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; }
};
inline std::ostream& operator<<(std::ostream& _out, WorkingProgress _p)
{
float mh = _p.rate() / 1000000.0f;

Loading…
Cancel
Save