aboutsummaryrefslogtreecommitdiffstats
path: root/trie.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-03-02 05:54:05 +0800
committerGav Wood <i@gavwood.com>2015-03-06 19:45:23 +0800
commit19324009e1129b7411910865258794b0518eddf8 (patch)
tree57f15bbb7637ca8c38cd01168013cfbbccbe92a8 /trie.cpp
parent23f10dae8a8e95cd5302b60ceb70b43cb9e60063 (diff)
downloaddexon-solidity-19324009e1129b7411910865258794b0518eddf8.tar
dexon-solidity-19324009e1129b7411910865258794b0518eddf8.tar.gz
dexon-solidity-19324009e1129b7411910865258794b0518eddf8.tar.bz2
dexon-solidity-19324009e1129b7411910865258794b0518eddf8.tar.lz
dexon-solidity-19324009e1129b7411910865258794b0518eddf8.tar.xz
dexon-solidity-19324009e1129b7411910865258794b0518eddf8.tar.zst
dexon-solidity-19324009e1129b7411910865258794b0518eddf8.zip
State integration test.
Fixes to the FatTrie.
Diffstat (limited to 'trie.cpp')
-rw-r--r--trie.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/trie.cpp b/trie.cpp
index 18e115da..84d0e846 100644
--- a/trie.cpp
+++ b/trie.cpp
@@ -54,6 +54,26 @@ using dev::operator <<;
BOOST_AUTO_TEST_SUITE(TrieTests)
+BOOST_AUTO_TEST_CASE(fat_trie)
+{
+ h256 r;
+ MemoryDB fm;
+ {
+ FatGenericTrieDB<MemoryDB> ft(&fm);
+ ft.init();
+ ft.insert(h256("69", h256::FromHex, h256::AlignRight).ref(), h256("414243", h256::FromHex, h256::AlignRight).ref());
+ for (auto i: ft)
+ cnote << i.first << i.second;
+ r = ft.root();
+ }
+ {
+ FatGenericTrieDB<MemoryDB> ft(&fm);
+ ft.setRoot(r);
+ for (auto i: ft)
+ cnote << i.first << i.second;
+ }
+}
+
BOOST_AUTO_TEST_CASE(trie_test_anyorder)
{
string testPath = test::getTestPath();