diff --git a/trie.cpp b/trie.cpp index 67f706917..e2117228e 100644 --- a/trie.cpp +++ b/trie.cpp @@ -67,9 +67,14 @@ BOOST_AUTO_TEST_CASE(trie_tests) cnote << i.first; js::mObject& o = i.second.get_obj(); vector> ss; - for (auto i: o["in"].get_obj()) + for (auto i: o["in"].get_array()) { - ss.push_back(make_pair(i.first, i.second.get_str())); + vector values; + for (auto s: i.get_array()) + values.push_back(s.get_str()); + + assert(values.size() == 2); + ss.push_back(make_pair(values[0], values[1])); if (!ss.back().first.find("0x")) ss.back().first = asString(fromHex(ss.back().first.substr(2))); if (!ss.back().second.find("0x")) @@ -88,7 +93,9 @@ BOOST_AUTO_TEST_CASE(trie_tests) BOOST_REQUIRE(t.check(true)); } BOOST_REQUIRE(!o["root"].is_null()); - BOOST_CHECK_EQUAL(o["root"].get_str(), toHex(t.root().asArray())); + BOOST_CHECK_EQUAL(o["root"].get_str(), "0x" + toHex(t.root().asArray())); + if (o["root"].get_str() != "0x" + toHex(t.root().asArray())) + break; } } }