diff --git a/libethereum/Block.cpp b/libethereum/Block.cpp index 1c8dc1b21..fd2a51527 100644 --- a/libethereum/Block.cpp +++ b/libethereum/Block.cpp @@ -709,7 +709,7 @@ bool Block::sealBlock(bytesConstRef _header) ret.appendRaw(m_currentTxs); ret.appendRaw(m_currentUncles); ret.swapOut(m_currentBytes); - m_currentBlock = BlockInfo(_header, CheckNothing, h256(), HeaderData); + m_currentBlock = Ethash::BlockHeader(_header, CheckNothing, h256(), HeaderData); cnote << "Mined " << m_currentBlock.hash() << "(parent: " << m_currentBlock.parentHash() << ")"; // TODO: move into Sealer StructuredLogger::minedNewBlock( diff --git a/libethereum/Block.h b/libethereum/Block.h index feadbba73..f030661f1 100644 --- a/libethereum/Block.h +++ b/libethereum/Block.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include "Account.h" @@ -252,7 +253,7 @@ public: bytes const& blockData() const { return m_currentBytes; } /// Get the header information on the present block. - BlockInfo const& info() const { return m_currentBlock; } + Ethash::BlockHeader const& info() const { return m_currentBlock; } private: @@ -288,7 +289,7 @@ private: State m_precommit; ///< State at the point immediately prior to rewards. BlockInfo m_previousBlock; ///< The previous block's information. - BlockInfo m_currentBlock; ///< The current block's information. + Ethash::BlockHeader m_currentBlock; ///< The current block's information. bytes m_currentBytes; ///< The current block. bool m_committedToMine = false; ///< Have we committed to mine on the present m_currentBlock? diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 83a50a1f7..6cc4e8d05 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -143,7 +143,8 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) vBiBlocks.clear(); vBiBlocks.push_back(biGenesisBlock); - TransientDirectory td_stateDB, td_bc; + TransientDirectory td_bc; + TransientDirectory td_stateDB; FullBlockChain bc(rlpGenesisBlock.out(), AccountMap(), td_bc.path(), WithExisting::Kill); //OverlayDB database (State::openDB(td_stateDB.path(), h256{}, WithExisting::Kill)); @@ -206,7 +207,9 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) //block.commitToSeal(bc); //Block block(State::openDB(bc.genesisHash()), BaseState::Empty, biGenesisBlock.beneficiary()); - Block block = bc.genesisBlock(State::openDB(bc.genesisHash())); //NOT CLEAR WHAT IT RETURNS IF bc INITIALIZED WITH CUSTOM GENESIS BLOCK + + //trueState TempDir default constructor for bc's state same as for trueState ? + Block block = bc.genesisBlock(trueState.db()); //NOT CLEAR WHAT IT RETURNS IF bc INITIALIZED WITH CUSTOM GENESIS BLOCK //Block block (State::openDB(biGenesisBlock.hash())); //Block block(state.db(), BaseState::Empty); //mine a new block on top of previously imported