Browse Source

fixing tests

cl-refactor
arkpar 10 years ago
parent
commit
0494ae2a7a
  1. 2
      libethcore/BlockInfo.h
  2. 3
      libethereum/BlockChain.cpp
  3. 3
      test/libethereum/blockchain.cpp

2
libethcore/BlockInfo.h

@ -145,7 +145,7 @@ public:
/// sha3 of the header only.
h256 const& hashWithout() const;
h256 const& hash() const { if (m_hash) return m_hash; throw NoHashRecorded(); }
h256 const& hash() const { if (m_hash) return m_hash; BOOST_THROW_EXCEPTION(NoHashRecorded()); }
void clear();
void noteDirty() const { m_hashWithout = m_boundary = m_hash = h256(); }

3
libethereum/BlockChain.cpp

@ -180,7 +180,8 @@ unsigned BlockChain::open(std::string const& _path, WithExisting _we)
bytes status = contents(extrasPath + "/minor");
unsigned lastMinor = c_minorProtocolVersion;
DEV_IGNORE_EXCEPTIONS(lastMinor = (unsigned)RLP(status));
if (!status.empty())
DEV_IGNORE_EXCEPTIONS(lastMinor = (unsigned)RLP(status));
if (c_minorProtocolVersion != lastMinor)
{
cnote << "Killing extras database (DB minor version:" << lastMinor << " != our miner version: " << c_minorProtocolVersion << ").";

3
test/libethereum/blockchain.cpp

@ -127,9 +127,10 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
TransientDirectory td_stateDB, td_bc;
FullBlockChain<Ethash> bc(rlpGenesisBlock.out(), StateDefinition(), td_bc.path(), WithExisting::Kill);
State state(OverlayDB(State::openDB(td_stateDB.path(), h256{}, WithExisting::Kill)), BaseState::Empty);
trueState.setAddress(biGenesisBlock.coinbaseAddress());
state.setAddress(biGenesisBlock.coinbaseAddress());
importer.importState(o["pre"].get_obj(), state);
state.commit();
state.sync(bc);
for (size_t i = 1; i < importBlockNumber; i++) //0 block is genesis
{

Loading…
Cancel
Save