mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Repotted a lot of the Trie stuff.
This commit is contained in:
parent
308b3d2d50
commit
d0381ed9f1
12
main.cpp
12
main.cpp
@ -26,7 +26,9 @@
|
|||||||
#include <secp256k1.h>
|
#include <secp256k1.h>
|
||||||
#include "Dagger.h"
|
#include "Dagger.h"
|
||||||
#include "RLP.h"
|
#include "RLP.h"
|
||||||
#include "Trie.h"
|
#include "TrieHash.h"
|
||||||
|
#include "TrieDB.h"
|
||||||
|
#include "MemTrie.h"
|
||||||
#include "State.h"
|
#include "State.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
@ -162,13 +164,13 @@ int main()
|
|||||||
cout << RLP(rlp256({{"b", "B"}, {"a", "A"}})) << endl;
|
cout << RLP(rlp256({{"b", "B"}, {"a", "A"}})) << endl;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Trie t;
|
MemTrie t;
|
||||||
t.insert("dog", "puppy");
|
t.insert("dog", "puppy");
|
||||||
cout << hex << t.hash256() << endl;
|
cout << hex << t.hash256() << endl;
|
||||||
cout << RLP(t.rlp()) << endl;
|
cout << RLP(t.rlp()) << endl;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Trie t;
|
MemTrie t;
|
||||||
t.insert("bed", "d");
|
t.insert("bed", "d");
|
||||||
t.insert("be", "e");
|
t.insert("be", "e");
|
||||||
cout << hex << t.hash256() << endl;
|
cout << hex << t.hash256() << endl;
|
||||||
@ -176,7 +178,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
cout << hex << hash256({{"dog", "puppy"}, {"doe", "reindeer"}}) << endl;
|
cout << hex << hash256({{"dog", "puppy"}, {"doe", "reindeer"}}) << endl;
|
||||||
Trie t;
|
MemTrie t;
|
||||||
t.insert("dog", "puppy");
|
t.insert("dog", "puppy");
|
||||||
t.insert("doe", "reindeer");
|
t.insert("doe", "reindeer");
|
||||||
cout << hex << t.hash256() << endl;
|
cout << hex << t.hash256() << endl;
|
||||||
@ -187,7 +189,7 @@ int main()
|
|||||||
BasicMap m;
|
BasicMap m;
|
||||||
GenericTrieDB<BasicMap> d(&m);
|
GenericTrieDB<BasicMap> d(&m);
|
||||||
d.init(); // initialise as empty tree.
|
d.init(); // initialise as empty tree.
|
||||||
Trie t;
|
MemTrie t;
|
||||||
StringMap s;
|
StringMap s;
|
||||||
|
|
||||||
auto add = [&](char const* a, char const* b)
|
auto add = [&](char const* a, char const* b)
|
||||||
|
Loading…
Reference in New Issue
Block a user