diff --git a/libraries/state_history/create_deltas.cpp b/libraries/state_history/create_deltas.cpp index 1b2737fc95..4344ade76d 100644 --- a/libraries/state_history/create_deltas.cpp +++ b/libraries/state_history/create_deltas.cpp @@ -102,6 +102,10 @@ std::vector create_deltas(const chainbase::database& db, bool full_ for (auto& row : undo.new_values) { delta.rows.obj.emplace_back(true, pack_row(row)); } + + if(delta.rows.obj.empty()) { + deltas.pop_back(); + } } }; diff --git a/unittests/state_history_tests.cpp b/unittests/state_history_tests.cpp index 4e4510d5f1..763e91e531 100644 --- a/unittests/state_history_tests.cpp +++ b/unittests/state_history_tests.cpp @@ -57,6 +57,16 @@ class table_deltas_tester : public tester { deltas_vector v; }; +BOOST_AUTO_TEST_CASE(test_deltas_not_empty) { + table_deltas_tester chain; + + auto deltas = eosio::state_history::create_deltas(chain.control->db(), false); + + for(const auto &delta: deltas) { + BOOST_REQUIRE(!delta.rows.obj.empty()); + } +} + BOOST_AUTO_TEST_CASE(test_deltas_account_creation) { table_deltas_tester chain; chain.produce_block();