aboutsummaryrefslogtreecommitdiffstats
path: root/trie.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2014-06-29 01:23:32 +0800
committerGav Wood <i@gavwood.com>2014-06-29 01:23:32 +0800
commitd8e04c43b18a9b20e9a215e7795424e305932e09 (patch)
treebc82b1e28a908119df12789e32f56530849d02b2 /trie.cpp
parentb62f71c699de687268b5d83a526f66027fca07ea (diff)
downloaddexon-solidity-d8e04c43b18a9b20e9a215e7795424e305932e09.tar.gz
dexon-solidity-d8e04c43b18a9b20e9a215e7795424e305932e09.tar.zst
dexon-solidity-d8e04c43b18a9b20e9a215e7795424e305932e09.zip
Full python serpent support.
Shared libs on all platforms.
Diffstat (limited to 'trie.cpp')
-rw-r--r--trie.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/trie.cpp b/trie.cpp
index 1ba69833..51735ed9 100644
--- a/trie.cpp
+++ b/trie.cpp
@@ -55,13 +55,18 @@ BOOST_AUTO_TEST_CASE(trie_tests)
js::read_string(s, v);
for (auto& i: v.get_obj())
{
+ cnote << i.first;
js::mObject& o = i.second.get_obj();
-// cnote << i.first;
vector<pair<string, string>> ss;
- for (auto& i: o["in"].get_obj())
+ for (auto i: o["in"].get_obj())
+ {
ss.push_back(make_pair(i.first, i.second.get_str()));
- cnote << ss;
- for (unsigned j = 0; j < eth::test::fac((unsigned)ss.size()); ++j)
+ if (!ss.back().first.find("0x"))
+ ss.back().first = asString(fromHex(ss.back().first.substr(2)));
+ if (!ss.back().second.find("0x"))
+ ss.back().second = asString(fromHex(ss.back().second.substr(2)));
+ }
+ for (unsigned j = 0; j < min(1000u, eth::test::fac((unsigned)ss.size())); ++j)
{
next_permutation(ss.begin(), ss.end());
MemoryDB m;
@@ -70,7 +75,6 @@ BOOST_AUTO_TEST_CASE(trie_tests)
BOOST_REQUIRE(t.check(true));
for (auto const& k: ss)
{
-// cdebug << k.first << k.second;
t.insert(k.first, k.second);
BOOST_REQUIRE(t.check(true));
}