Browse Source

Move OverlayDB (leveldb dependent) back into libdevcrypto.

cl-refactor
Gav Wood 10 years ago
parent
commit
715a63620b
  1. 1
      libdevcore/TrieDB.h
  2. 0
      libdevcrypto/OverlayDB.cpp
  3. 2
      libdevcrypto/OverlayDB.h
  4. 7
      libethereum/CachedAddressState.cpp
  5. 1
      libethereum/State.h
  6. 4
      test/deprecated/main.cpp

1
libdevcore/TrieDB.h

@ -32,7 +32,6 @@
#include <libdevcore/Exceptions.h> #include <libdevcore/Exceptions.h>
#include <libdevcore/SHA3.h> #include <libdevcore/SHA3.h>
#include "MemoryDB.h" #include "MemoryDB.h"
#include "OverlayDB.h"
#include "TrieCommon.h" #include "TrieCommon.h"
namespace ldb = leveldb; namespace ldb = leveldb;

0
libdevcore/OverlayDB.cpp → libdevcrypto/OverlayDB.cpp

2
libdevcore/OverlayDB.h → libdevcrypto/OverlayDB.h

@ -29,7 +29,7 @@
#include <memory> #include <memory>
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/Log.h> #include <libdevcore/Log.h>
#include "MemoryDB.h" #include <libdevcore/MemoryDB.h>
namespace ldb = leveldb; namespace ldb = leveldb;
namespace dev namespace dev

7
libethereum/CachedAddressState.cpp

@ -21,8 +21,9 @@
#include "CachedAddressState.h" #include "CachedAddressState.h"
#include <libdevcrypto/Common.h>
#include <libdevcore/TrieDB.h> #include <libdevcore/TrieDB.h>
#include <libdevcrypto/Common.h>
#include <libdevcrypto/OverlayDB.h>
#include "Account.h" #include "Account.h"
using namespace std; using namespace std;
using namespace dev; using namespace dev;
@ -57,8 +58,8 @@ std::unordered_map<u256, u256> CachedAddressState::storage() const
if (m_r) if (m_r)
{ {
SecureTrieDB<h256, OverlayDB> memdb(const_cast<OverlayDB*>(m_o), m_r[2].toHash<h256>()); // promise we won't alter the overlay! :) SecureTrieDB<h256, OverlayDB> memdb(const_cast<OverlayDB*>(m_o), m_r[2].toHash<h256>()); // promise we won't alter the overlay! :)
// for (auto const& j: memdb) for (auto const& j: memdb)
// ret[j.first] = RLP(j.second).toInt<u256>(); ret[j.first] = RLP(j.second).toInt<u256>();
} }
if (m_s) if (m_s)
for (auto const& j: m_s->storageOverlay()) for (auto const& j: m_s->storageOverlay())

1
libethereum/State.h

@ -26,6 +26,7 @@
#include <libdevcore/Common.h> #include <libdevcore/Common.h>
#include <libdevcore/RLP.h> #include <libdevcore/RLP.h>
#include <libdevcore/TrieDB.h> #include <libdevcore/TrieDB.h>
#include <libdevcrypto/OverlayDB.h>
#include <libethcore/Exceptions.h> #include <libethcore/Exceptions.h>
#include <libethcore/BlockInfo.h> #include <libethcore/BlockInfo.h>
#include <libethcore/ProofOfWork.h> #include <libethcore/ProofOfWork.h>

4
test/deprecated/main.cpp

@ -20,10 +20,6 @@
* Main test functions. * Main test functions.
*/ */
#include <libdevcore/TrieDB.h>
#include "TrieHash.h"
#include "MemTrie.h"
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
int trieTest(); int trieTest();

Loading…
Cancel
Save