Ethereum  PoC-8
The C++ Implementation of Ethereum
BlockChainImporter.h
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16 */
21 #pragma once
22 
23 #include <libdevcore/Common.h>
24 
25 #include <memory>
26 
27 namespace dev
28 {
29 
30 class RLP;
31 
32 namespace eth
33 {
34 
35 class BlockChain;
36 class BlockHeader;
37 
39 {
40 public:
41  virtual ~BlockChainImporterFace() = default;
42 
43  virtual void importBlock(BlockHeader const& _header, RLP _transactions, RLP _uncles, RLP _receipts, u256 const& _totalDifficulty) = 0;
44 
45  virtual void setChainStartBlockNumber(u256 const& _number) = 0;
46 };
47 
48 std::unique_ptr<BlockChainImporterFace> createBlockChainImporter(BlockChain& _blockChain);
49 
50 }
51 }
dev::eth::BlockHeader
Encapsulation of a block header. Class to contain all of a block header's data. It is able to parse a...
Definition: BlockHeader.h:97
dev::eth::BlockChainImporterFace
Definition: BlockChainImporter.h:39
dev::eth::BlockChainImporterFace::importBlock
virtual void importBlock(BlockHeader const &_header, RLP _transactions, RLP _uncles, RLP _receipts, u256 const &_totalDifficulty)=0
Common.h
dev::eth::BlockChain
Implements the blockchain database. All data this gives is disk-backed. @threadsafe.
Definition: BlockChain.h:105
dev::eth::BlockChainImporterFace::~BlockChainImporterFace
virtual ~BlockChainImporterFace()=default
dev::u256
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
Definition: Common.h:121
dev::eth::BlockChainImporterFace::setChainStartBlockNumber
virtual void setChainStartBlockNumber(u256 const &_number)=0
dev
Definition: Address.cpp:21
dev::RLP
Definition: RLP.h:48
dev::eth::createBlockChainImporter
std::unique_ptr< BlockChainImporterFace > createBlockChainImporter(BlockChain &_blockChain)
Definition: BlockChainImporter.cpp:60