From 82612a70271dfc3c7a00bd9cc6acfafa4fff1f65 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 4 Mar 2014 12:43:27 -0600 Subject: [PATCH] Move additional Trie implementations to tests where they belong. --- .gitignore | 3 --- libethereum/FixedHash.h | 2 +- {libethereum => test}/MemTrie.cpp | 5 +++-- {libethereum => test}/MemTrie.h | 3 ++- {libethereum => test}/TrieHash.cpp | 5 +++-- {libethereum => test}/TrieHash.h | 4 ++-- test/trie.cpp | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) rename {libethereum => test}/MemTrie.cpp (99%) rename {libethereum => test}/MemTrie.h (96%) rename {libethereum => test}/TrieHash.cpp (99%) rename {libethereum => test}/TrieHash.h (95%) diff --git a/.gitignore b/.gitignore index bcdbfa12d..90c2da58c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,6 @@ ipch *.opensdf *.suo -# Generated headers -*.h - *.user *.user.* *~ diff --git a/libethereum/FixedHash.h b/libethereum/FixedHash.h index 6fcf0ea2b..a72b45e9f 100644 --- a/libethereum/FixedHash.h +++ b/libethereum/FixedHash.h @@ -62,7 +62,7 @@ public: explicit FixedHash(byte const* _bs, ConstructFromPointerType) { memcpy(m_data.data(), _bs, N); } /// Explicitly construct, copying from a string. - explicit FixedHash(std::string const& _s, ConstructFromStringType _t = FromHex): FixedHash(_t == FromHex ? fromHex(_s) : asBytes(_s)) {} + explicit FixedHash(std::string const& _s, ConstructFromStringType _t = FromHex): FixedHash(_t == FromHex ? fromHex(_s) : eth::asBytes(_s)) {} /// Convert to arithmetic type. operator Arith() const { return fromBigEndian(m_data); } diff --git a/libethereum/MemTrie.cpp b/test/MemTrie.cpp similarity index 99% rename from libethereum/MemTrie.cpp rename to test/MemTrie.cpp index c9d257c05..0a7d0ebe4 100644 --- a/libethereum/MemTrie.cpp +++ b/test/MemTrie.cpp @@ -19,9 +19,10 @@ * @date 2014 */ -#include "CommonEth.h" -#include "TrieCommon.h" #include "MemTrie.h" + +#include +#include using namespace std; using namespace eth; diff --git a/libethereum/MemTrie.h b/test/MemTrie.h similarity index 96% rename from libethereum/MemTrie.h rename to test/MemTrie.h index d956c1d8a..622ea531d 100644 --- a/libethereum/MemTrie.h +++ b/test/MemTrie.h @@ -21,7 +21,8 @@ #pragma once -#include "Common.h" +#include +#include namespace eth { diff --git a/libethereum/TrieHash.cpp b/test/TrieHash.cpp similarity index 99% rename from libethereum/TrieHash.cpp rename to test/TrieHash.cpp index b4e3a7eb4..61840b0e8 100644 --- a/libethereum/TrieHash.cpp +++ b/test/TrieHash.cpp @@ -19,9 +19,10 @@ * @date 2014 */ -#include "CommonEth.h" -#include "TrieCommon.h" #include "TrieHash.h" + +#include +#include using namespace std; using namespace eth; diff --git a/libethereum/TrieHash.h b/test/TrieHash.h similarity index 95% rename from libethereum/TrieHash.h rename to test/TrieHash.h index dcdcfd86a..e69b2b7b3 100644 --- a/libethereum/TrieHash.h +++ b/test/TrieHash.h @@ -21,8 +21,8 @@ #pragma once -#include "Common.h" -#include "FixedHash.h" +#include +#include namespace eth { diff --git a/test/trie.cpp b/test/trie.cpp index 419602d62..9d2bb3763 100644 --- a/test/trie.cpp +++ b/test/trie.cpp @@ -24,9 +24,9 @@ #include "../json_spirit/json_spirit_reader_template.h" #include "../json_spirit/json_spirit_writer_template.h" #include -#include #include -#include +#include "TrieHash.h" +#include "MemTrie.h" using namespace std; using namespace eth;