Skip to content

Commit 9ec21b1

Browse files
authored
Merge pull request #1073 from xiangxn/merge-impacted
merge impacted into db_notify
2 parents 8ea50ca + 6fda1bc commit 9ec21b1

File tree

7 files changed

+10
-295
lines changed

7 files changed

+10
-295
lines changed

libraries/app/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ add_library( graphene_app
66
application.cpp
77
util.cpp
88
database_api.cpp
9-
impacted.cpp
109
plugin.cpp
1110
${HEADERS}
1211
${EGENESIS_HEADERS}

libraries/app/api.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <graphene/app/api.hpp>
2727
#include <graphene/app/api_access.hpp>
2828
#include <graphene/app/application.hpp>
29-
#include <graphene/app/impacted.hpp>
3029
#include <graphene/chain/database.hpp>
3130
#include <graphene/chain/get_config.hpp>
3231
#include <graphene/utilities/key_conversion.hpp>

libraries/app/impacted.cpp

-284
This file was deleted.

libraries/chain/db_notify.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <graphene/chain/operation_history_object.hpp>
1515
#include <graphene/chain/vesting_balance_object.hpp>
1616
#include <graphene/chain/transaction_object.hpp>
17+
#include <graphene/chain/impacted.hpp>
1718

1819
using namespace fc;
1920
using namespace graphene::chain;
@@ -257,19 +258,19 @@ struct get_impacted_account_visitor
257258
}
258259
};
259260

260-
static void operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result )
261+
void graphene::chain::operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result )
261262
{
262263
get_impacted_account_visitor vtor = get_impacted_account_visitor( result );
263264
op.visit( vtor );
264265
}
265266

266-
static void transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result )
267+
void graphene::chain::transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result )
267268
{
268269
for( const auto& op : tx.operations )
269270
operation_get_impacted_accounts( op, result );
270271
}
271272

272-
static void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accounts )
273+
void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accounts )
273274
{
274275
if( obj->id.space() == protocol_ids )
275276
{

libraries/app/include/graphene/app/impacted.hpp renamed to libraries/chain/include/graphene/chain/impacted.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <graphene/chain/protocol/transaction.hpp>
2929
#include <graphene/chain/protocol/types.hpp>
3030

31-
namespace graphene { namespace app {
31+
namespace graphene { namespace chain {
3232

3333
void operation_get_impacted_accounts(
3434
const graphene::chain::operation& op,
@@ -39,4 +39,4 @@ void transaction_get_impacted_accounts(
3939
fc::flat_set<graphene::chain::account_id_type>& result
4040
);
4141

42-
} } // graphene::app
42+
} } // graphene::app

libraries/plugins/account_history/account_history_plugin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <graphene/account_history/account_history_plugin.hpp>
2626

27-
#include <graphene/app/impacted.hpp>
27+
#include <graphene/chain/impacted.hpp>
2828

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

139139
for( auto& a : other )
140140
for( auto& item : a.account_auths )

libraries/plugins/elasticsearch/elasticsearch_plugin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <graphene/elasticsearch/elasticsearch_plugin.hpp>
2626

27-
#include <graphene/app/impacted.hpp>
27+
#include <graphene/chain/impacted.hpp>
2828

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

140140
for( auto& a : other )
141141
for( auto& item : a.account_auths )

0 commit comments

Comments
 (0)