diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 34ad1c6f..1e09116a 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ class es_objects_plugin_impl bool _es_objects_committee_member = true; bool _es_objects_nft = true; bool _es_objects_son = true; + bool _es_objects_transaction = true; bool _es_objects_vesting_balance = true; bool _es_objects_witness = true; bool _es_objects_worker = true; @@ -231,6 +233,14 @@ bool es_objects_plugin_impl::genesis() prepareTemplate(*b, "son_wallet_withdraw"); }); } + if (_es_objects_transaction) { + auto &idx = db.get_index_type(); + idx.inspect_all_objects([this, &db](const graphene::db::object &o) { + auto obj = db.find_object(o.id); + auto b = static_cast(obj); + prepareTemplate(*b, "transaction"); + }); + } if (_es_objects_vesting_balance) { auto &idx = db.get_index_type(); idx.inspect_all_objects([this, &db](const graphene::db::object &o) { @@ -449,6 +459,15 @@ bool es_objects_plugin_impl::index_database(const vector& ids, s else prepareTemplate(*ba, "son_wallet_withdraw"); } + } else if (value.is() && _es_objects_transaction) { + auto obj = db.find_object(value); + auto ba = static_cast(obj); + if (ba != nullptr) { + if (action == "delete") + remove_from_database(ba->id, "transaction"); + else + prepareTemplate(*ba, "transaction"); + } } else if (value.is() && _es_objects_vesting_balance) { auto obj = db.find_object(value); auto ba = static_cast(obj); @@ -592,7 +611,8 @@ void es_objects_plugin::plugin_set_program_options( ("es-objects-committee-member", boost::program_options::value(), "Store committee member objects(true)") ("es-objects-nft", boost::program_options::value(), "Store nft objects (true)") ("es-objects-son", boost::program_options::value(), "Store son objects (true)") - ("es-objects-vesting_balance", boost::program_options::value(), "Store vesting balance objects (true)") + ("es-objects-transaction", boost::program_options::value(), "Store transaction objects (true)") + ("es-objects-vesting-balance", boost::program_options::value(), "Store vesting balance objects (true)") ("es-objects-witness", boost::program_options::value(), "Store witness objects (true)") ("es-objects-worker", boost::program_options::value(), "Store worker objects (true)") ("es-objects-index-prefix", boost::program_options::value(), @@ -637,6 +657,30 @@ void es_objects_plugin::plugin_initialize(const boost::program_options::variable if (options.count("es-objects-asset-bitasset")) { my->_es_objects_asset_bitasset = options["es-objects-asset-bitasset"].as(); } + if (options.count("es-objects-account-role")) { + my->_es_objects_balances = options["es-objects-account-role"].as(); + } + if (options.count("es-objects-committee-member")) { + my->_es_objects_balances = options["es-objects-committee-member"].as(); + } + if (options.count("es-objects-nft")) { + my->_es_objects_balances = options["es-objects-nft"].as(); + } + if (options.count("es-objects-son")) { + my->_es_objects_balances = options["es-objects-son"].as(); + } + if (options.count("es-objects-transaction")) { + my->_es_objects_balances = options["es-objects-transaction"].as(); + } + if (options.count("es-objects-vesting-balance")) { + my->_es_objects_balances = options["es-objects-vesting-balance"].as(); + } + if (options.count("es-objects-witness")) { + my->_es_objects_balances = options["es-objects-witness"].as(); + } + if (options.count("es-objects-worker")) { + my->_es_objects_balances = options["es-objects-worker"].as(); + } if (options.count("es-objects-index-prefix")) { my->_es_objects_index_prefix = options["es-objects-index-prefix"].as(); }