![]() |
Ethereum
PoC-8
The C++ Implementation of Ethereum
|
Encapsulation of a block header. Class to contain all of a block header's data. It is able to parse a block header and populate from some given RLP block serialisation with the static fromHeader(), through the method populate(). This will not conduct any verification above basic formating. In this case extra verification can be performed through verify(). More...
#include <BlockHeader.h>
Public Member Functions | |
| BlockHeader () | |
| BlockHeader (bytesConstRef _data, BlockDataType _bdt=BlockData, h256 const &_hashWith=h256()) | |
| BlockHeader (bytes const &_data, BlockDataType _bdt=BlockData, h256 const &_hashWith=h256()) | |
| BlockHeader (BlockHeader const &_other) | |
| BlockHeader & | operator= (BlockHeader const &_other) |
| operator bool () const | |
| bool | operator== (BlockHeader const &_cmp) const |
| bool | operator!= (BlockHeader const &_cmp) const |
| void | clear () |
| void | noteDirty () const |
| void | populateFromParent (BlockHeader const &parent) |
| void | verify (Strictness _s=CheckEverything, BlockHeader const &_parent=BlockHeader(), bytesConstRef _block=bytesConstRef()) const |
| void | verify (Strictness _s, bytesConstRef _block) const |
| h256 | hash (IncludeSeal _i=WithSeal) const |
| void | streamRLP (RLPStream &_s, IncludeSeal _i=WithSeal) const |
| void | setParentHash (h256 const &_v) |
| void | setSha3Uncles (h256 const &_v) |
| void | setTimestamp (int64_t _v) |
| void | setAuthor (Address const &_v) |
| void | setRoots (h256 const &_t, h256 const &_r, h256 const &_u, h256 const &_s) |
| void | setGasUsed (u256 const &_v) |
| void | setNumber (int64_t _v) |
| void | setGasLimit (u256 const &_v) |
| void | setExtraData (bytes const &_v) |
| void | setLogBloom (LogBloom const &_v) |
| void | setDifficulty (u256 const &_v) |
| template<class T > | |
| void | setSeal (unsigned _offset, T const &_value) |
| template<class T > | |
| void | setSeal (T const &_value) |
| h256 const & | parentHash () const |
| h256 const & | sha3Uncles () const |
| bool | hasUncles () const |
| int64_t | timestamp () const |
| Address const & | author () const |
| h256 const & | stateRoot () const |
| h256 const & | transactionsRoot () const |
| h256 const & | receiptsRoot () const |
| u256 const & | gasUsed () const |
| int64_t | number () const |
| u256 const & | gasLimit () const |
| bytes const & | extraData () const |
| LogBloom const & | logBloom () const |
| u256 const & | difficulty () const |
| template<class T > | |
| T | seal (unsigned _offset=0) const |
Static Public Member Functions | |
| static h256 | headerHashFromBlock (bytes const &_block) |
| static h256 | headerHashFromBlock (bytesConstRef _block) |
| static RLP | extractHeader (bytesConstRef _block) |
Static Public Attributes | |
| static const unsigned | BasicFields = 13 |
Friends | |
| class | BlockChain |
Encapsulation of a block header. Class to contain all of a block header's data. It is able to parse a block header and populate from some given RLP block serialisation with the static fromHeader(), through the method populate(). This will not conduct any verification above basic formating. In this case extra verification can be performed through verify().
The object may also be populated from an entire block through the explicit constructor BlockHeader(bytesConstRef) and manually with the populate() method. These will conduct verification of the header against the other information in the block.
The object may be populated with a template given a parent BlockHeader object with the populateFromParent() method. The genesis block info may be retrieved with genesis() and the corresponding RLP block created with createGenesisBlock().
To determine the header hash without the nonce (for sealing), the method hash(WithoutNonce) is provided.
The default constructor creates an empty object, which can be tested against with the boolean conversion operator.
Definition at line 96 of file BlockHeader.h.
| BlockHeader::BlockHeader | ( | ) |
Definition at line 35 of file BlockHeader.cpp.
|
explicit |
Definition at line 39 of file BlockHeader.cpp.
|
inlineexplicit |
Definition at line 104 of file BlockHeader.h.
| BlockHeader::BlockHeader | ( | BlockHeader const & | _other | ) |
Definition at line 46 of file BlockHeader.cpp.
|
inline |
Definition at line 161 of file BlockHeader.h.
| void BlockHeader::clear | ( | ) |
Definition at line 100 of file BlockHeader.cpp.
|
inline |
Definition at line 170 of file BlockHeader.h.
|
static |
Definition at line 156 of file BlockHeader.cpp.
|
inline |
Definition at line 168 of file BlockHeader.h.
|
inline |
Definition at line 167 of file BlockHeader.h.
|
inline |
Definition at line 165 of file BlockHeader.h.
| h256 BlockHeader::hash | ( | IncludeSeal | _i = WithSeal | ) | const |
Definition at line 119 of file BlockHeader.cpp.
|
inline |
Definition at line 159 of file BlockHeader.h.
Definition at line 108 of file BlockHeader.h.
|
static |
Definition at line 151 of file BlockHeader.cpp.
|
inline |
Definition at line 169 of file BlockHeader.h.
|
inline |
Definition at line 133 of file BlockHeader.h.
|
inline |
Definition at line 166 of file BlockHeader.h.
|
inlineexplicit |
Definition at line 112 of file BlockHeader.h.
|
inline |
Definition at line 130 of file BlockHeader.h.
| BlockHeader & BlockHeader::operator= | ( | BlockHeader const & | _other | ) |
Definition at line 67 of file BlockHeader.cpp.
|
inline |
Definition at line 114 of file BlockHeader.h.
|
inline |
Definition at line 157 of file BlockHeader.h.
| void BlockHeader::populateFromParent | ( | BlockHeader const & | parent | ) |
Definition at line 200 of file BlockHeader.cpp.
|
inline |
Definition at line 164 of file BlockHeader.h.
|
inline |
Definition at line 171 of file BlockHeader.h.
|
inline |
Definition at line 146 of file BlockHeader.h.
|
inline |
Definition at line 153 of file BlockHeader.h.
|
inline |
Definition at line 151 of file BlockHeader.h.
|
inline |
Definition at line 150 of file BlockHeader.h.
|
inline |
Definition at line 148 of file BlockHeader.h.
|
inline |
Definition at line 152 of file BlockHeader.h.
|
inline |
Definition at line 149 of file BlockHeader.h.
|
inline |
Definition at line 143 of file BlockHeader.h.
|
inline |
Definition at line 147 of file BlockHeader.h.
|
inline |
Definition at line 155 of file BlockHeader.h.
|
inline |
Definition at line 154 of file BlockHeader.h.
|
inline |
Definition at line 144 of file BlockHeader.h.
|
inline |
Definition at line 145 of file BlockHeader.h.
|
inline |
Definition at line 158 of file BlockHeader.h.
|
inline |
Definition at line 162 of file BlockHeader.h.
| void BlockHeader::streamRLP | ( | RLPStream & | _s, |
| IncludeSeal | _i = WithSeal |
||
| ) | const |
Definition at line 139 of file BlockHeader.cpp.
|
inline |
Definition at line 160 of file BlockHeader.h.
|
inline |
Definition at line 163 of file BlockHeader.h.
|
inline |
Definition at line 138 of file BlockHeader.h.
| void BlockHeader::verify | ( | Strictness | _s = CheckEverything, |
| BlockHeader const & | _parent = BlockHeader(), |
||
| bytesConstRef | _block = bytesConstRef() |
||
| ) | const |
Definition at line 210 of file BlockHeader.cpp.
|
friend |
Definition at line 98 of file BlockHeader.h.
|
static |
Definition at line 100 of file BlockHeader.h.