aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-01-19 21:32:01 +0800
committerGav Wood <i@gavwood.com>2014-01-19 21:32:01 +0800
commitd0381ed9f1716a305da08bf6be70df6652b9c3c3 (patch)
treefb0c18512d7bb20060608efd4b52e556cb7f84a1
parent308b3d2d50ad84f2914e80d267a28b034942b8d6 (diff)
downloaddexon-solidity-d0381ed9f1716a305da08bf6be70df6652b9c3c3.tar.gz
dexon-solidity-d0381ed9f1716a305da08bf6be70df6652b9c3c3.tar.zst
dexon-solidity-d0381ed9f1716a305da08bf6be70df6652b9c3c3.zip
Repotted a lot of the Trie stuff.
-rw-r--r--main.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 85d0e768..f1fa9afb 100644
--- a/main.cpp
+++ b/main.cpp
@@ -26,7 +26,9 @@
#include <secp256k1.h>
#include "Dagger.h"
#include "RLP.h"
-#include "Trie.h"
+#include "TrieHash.h"
+#include "TrieDB.h"
+#include "MemTrie.h"
#include "State.h"
using namespace std;
using namespace std::chrono;
@@ -162,13 +164,13 @@ int main()
cout << RLP(rlp256({{"b", "B"}, {"a", "A"}})) << endl;
}
{
- Trie t;
+ MemTrie t;
t.insert("dog", "puppy");
cout << hex << t.hash256() << endl;
cout << RLP(t.rlp()) << endl;
}
{
- Trie t;
+ MemTrie t;
t.insert("bed", "d");
t.insert("be", "e");
cout << hex << t.hash256() << endl;
@@ -176,7 +178,7 @@ int main()
}
{
cout << hex << hash256({{"dog", "puppy"}, {"doe", "reindeer"}}) << endl;
- Trie t;
+ MemTrie t;
t.insert("dog", "puppy");
t.insert("doe", "reindeer");
cout << hex << t.hash256() << endl;
@@ -187,7 +189,7 @@ int main()
BasicMap m;
GenericTrieDB<BasicMap> d(&m);
d.init(); // initialise as empty tree.
- Trie t;
+ MemTrie t;
StringMap s;
auto add = [&](char const* a, char const* b)