diff --git a/unittests/state_history_tests.cpp b/unittests/state_history_tests.cpp index 711c89be5fe..82ffd19b49d 100644 --- a/unittests/state_history_tests.cpp +++ b/unittests/state_history_tests.cpp @@ -931,6 +931,11 @@ BOOST_AUTO_TEST_CASE(test_deltas_kv) { BOOST_REQUIRE_EQUAL(key_values[0].contract.to_string(), "kvtable"); BOOST_REQUIRE_EQUAL(key_values[0].payer.to_string(), "kvtable"); + std::string key = string(key_values[0].key.pos, key_values[0].key.remaining()); + std::string val = string(key_values[0].value.pos, key_values[0].value.remaining()); + BOOST_REQUIRE_EQUAL(fc::to_hex(key.data(), key.size()), "00"); + BOOST_REQUIRE_EQUAL(fc::to_hex(val.data(), val.size()), "7897"); + chain.produce_block(); result = chain.find_table_delta("key_value"); @@ -938,11 +943,19 @@ BOOST_AUTO_TEST_CASE(test_deltas_kv) { result = chain.find_table_delta("key_value", true); BOOST_REQUIRE(result.first); + + key_values = chain.deserialize_data(result.second); + BOOST_REQUIRE_EQUAL(key_values.size(), 1); BOOST_REQUIRE_EQUAL(result.second->rows.obj[0].first, 2); BOOST_REQUIRE_EQUAL(key_values[0].contract.to_string(), "kvtable"); BOOST_REQUIRE_EQUAL(key_values[0].payer.to_string(), "kvtable"); + key = string(key_values[0].key.pos, key_values[0].key.remaining()); + val = string(key_values[0].value.pos, key_values[0].value.remaining()); + BOOST_REQUIRE_EQUAL(fc::to_hex(key.data(), key.size()), "00"); + BOOST_REQUIRE_EQUAL(fc::to_hex(val.data(), val.size()), "7897"); + chain.produce_block(); trace = chain.push_action("kvtable"_n, "erase"_n, "kvtable"_n, mutable_variant_object()("contract", "kvtable"_n)("k", "00"));