Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge impacted into db_notify #1073

Merged
merged 2 commits into from
Jun 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libraries/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ add_library( graphene_app
application.cpp
util.cpp
database_api.cpp
impacted.cpp
plugin.cpp
${HEADERS}
${EGENESIS_HEADERS}
Expand Down
1 change: 0 additions & 1 deletion libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <graphene/app/api.hpp>
#include <graphene/app/api_access.hpp>
#include <graphene/app/application.hpp>
#include <graphene/app/impacted.hpp>
#include <graphene/chain/database.hpp>
#include <graphene/chain/get_config.hpp>
#include <graphene/utilities/key_conversion.hpp>
Expand Down
284 changes: 0 additions & 284 deletions libraries/app/impacted.cpp

This file was deleted.

7 changes: 4 additions & 3 deletions libraries/chain/db_notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <graphene/chain/operation_history_object.hpp>
#include <graphene/chain/vesting_balance_object.hpp>
#include <graphene/chain/transaction_object.hpp>
#include <graphene/chain/impacted.hpp>

using namespace fc;
using namespace graphene::chain;
Expand Down Expand Up @@ -257,19 +258,19 @@ struct get_impacted_account_visitor
}
};

static void operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result )
void graphene::chain::operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result )
{
get_impacted_account_visitor vtor = get_impacted_account_visitor( result );
op.visit( vtor );
}

static void transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result )
void graphene::chain::transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result )
{
for( const auto& op : tx.operations )
operation_get_impacted_accounts( op, result );
}

static void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accounts )
void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accounts )
{
if( obj->id.space() == protocol_ids )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <graphene/chain/protocol/transaction.hpp>
#include <graphene/chain/protocol/types.hpp>

namespace graphene { namespace app {
namespace graphene { namespace chain {

void operation_get_impacted_accounts(
const graphene::chain::operation& op,
Expand All @@ -39,4 +39,4 @@ void transaction_get_impacted_accounts(
fc::flat_set<graphene::chain::account_id_type>& result
);

} } // graphene::app
} } // graphene::app
4 changes: 2 additions & 2 deletions libraries/plugins/account_history/account_history_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <graphene/account_history/account_history_plugin.hpp>

#include <graphene/app/impacted.hpp>
#include <graphene/chain/impacted.hpp>

#include <graphene/chain/account_evaluator.hpp>
#include <graphene/chain/account_object.hpp>
Expand Down Expand Up @@ -134,7 +134,7 @@ void account_history_plugin_impl::update_account_histories( const signed_block&
if( op.op.which() == operation::tag< account_create_operation >::value )
impacted.insert( op.result.get<object_id_type>() );
else
graphene::app::operation_get_impacted_accounts( op.op, impacted );
graphene::chain::operation_get_impacted_accounts( op.op, impacted );

for( auto& a : other )
for( auto& item : a.account_auths )
Expand Down
4 changes: 2 additions & 2 deletions libraries/plugins/elasticsearch/elasticsearch_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <graphene/elasticsearch/elasticsearch_plugin.hpp>

#include <graphene/app/impacted.hpp>
#include <graphene/chain/impacted.hpp>

#include <graphene/chain/account_evaluator.hpp>
#include <graphene/chain/account_object.hpp>
Expand Down Expand Up @@ -135,7 +135,7 @@ void elasticsearch_plugin_impl::update_account_histories( const signed_block& b
if( op.op.which() == operation::tag< account_create_operation >::value )
impacted.insert( op.result.get<object_id_type>() );
else
graphene::app::operation_get_impacted_accounts( op.op, impacted );
graphene::chain::operation_get_impacted_accounts( op.op, impacted );

for( auto& a : other )
for( auto& item : a.account_auths )
Expand Down