Skip to content

Commit 48a5457

Browse files
Issue #210: Formatting and build fixes
1 parent a081fff commit 48a5457

File tree

13 files changed

+253
-241
lines changed

13 files changed

+253
-241
lines changed

libraries/app/database_api.cpp

+37-37
Original file line numberDiff line numberDiff line change
@@ -2268,71 +2268,71 @@ set<address> database_api::get_potential_address_signatures( const signed_transa
22682268
return my->get_potential_address_signatures( trx );
22692269
}
22702270

2271-
set<public_key_type> database_api_impl::get_potential_signatures(const signed_transaction& trx) const
2271+
set<public_key_type> database_api_impl::get_potential_signatures( const signed_transaction& trx )const
22722272
{
22732273
auto chain_time = _db.head_block_time();
2274-
bool allow_non_immediate_owner = (chain_time >= HARDFORK_CORE_584_TIME);
2275-
bool ignore_custom_op_reqd_auths = MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time);
2274+
bool allow_non_immediate_owner = ( chain_time >= HARDFORK_CORE_584_TIME );
2275+
bool ignore_custom_op_reqd_auths = MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( chain_time );
22762276

22772277
set<public_key_type> result;
2278-
auto get_active = [this, &result](account_id_type id) {
2279-
const auto& auth = id(_db).active;
2280-
for (const auto& k : auth.get_keys())
2281-
result.insert(k);
2278+
auto get_active = [this, &result]( account_id_type id ){
2279+
const auto& auth = id( _db ).active;
2280+
for( const auto& k : auth.get_keys() )
2281+
result.insert( k );
22822282
return &auth;
22832283
};
2284-
auto get_owner = [this, &result](account_id_type id) {
2285-
const auto& auth = id(_db).owner;
2286-
for (const auto& k : auth.get_keys())
2287-
result.insert(k);
2284+
auto get_owner = [this, &result]( account_id_type id ){
2285+
const auto& auth = id( _db ).owner;
2286+
for( const auto& k : auth.get_keys() )
2287+
result.insert( k );
22882288
return &auth;
22892289
};
22902290

2291-
trx.get_required_signatures(_db.get_chain_id(),
2292-
flat_set<public_key_type>(),
2293-
get_active, get_owner,
2294-
allow_non_immediate_owner,
2295-
ignore_custom_op_reqd_auths,
2296-
_db.get_global_properties().parameters.max_authority_depth);
2291+
trx.get_required_signatures( _db.get_chain_id(),
2292+
flat_set<public_key_type>(),
2293+
get_active, get_owner,
2294+
allow_non_immediate_owner,
2295+
ignore_custom_op_reqd_auths,
2296+
_db.get_global_properties().parameters.max_authority_depth );
22972297

22982298
// Insert keys in required "other" authories
22992299
flat_set<account_id_type> required_active;
23002300
flat_set<account_id_type> required_owner;
23012301
vector<authority> other;
2302-
trx.get_required_authorities(required_active, required_owner, other, ignore_custom_op_reqd_auths);
2303-
for (const auto& auth : other)
2304-
for (const auto& key : auth.get_keys())
2305-
result.insert(key);
2302+
trx.get_required_authorities( required_active, required_owner, other, ignore_custom_op_reqd_auths );
2303+
for( const auto& auth : other )
2304+
for( const auto& key : auth.get_keys() )
2305+
result.insert( key );
23062306

23072307
return result;
23082308
}
23092309

2310-
set<address> database_api_impl::get_potential_address_signatures(const signed_transaction& trx)const
2310+
set<address> database_api_impl::get_potential_address_signatures( const signed_transaction& trx )const
23112311
{
23122312
auto chain_time = _db.head_block_time();
2313-
bool allow_non_immediate_owner = (chain_time >= HARDFORK_CORE_584_TIME);
2314-
bool ignore_custom_op_reqd_auths = MUST_IGNORE_CUSTOM_OP_REQD_AUTHS(chain_time);
2313+
bool allow_non_immediate_owner = ( chain_time >= HARDFORK_CORE_584_TIME );
2314+
bool ignore_custom_op_reqd_auths = MUST_IGNORE_CUSTOM_OP_REQD_AUTHS( chain_time );
23152315

23162316
set<address> result;
2317-
auto get_active = [this, &result](account_id_type id) {
2318-
const auto& auth = id(_db).active;
2319-
for (const auto& k : auth.get_addresses())
2320-
result.insert(k);
2317+
auto get_active = [this, &result]( account_id_type id ){
2318+
const auto& auth = id( _db ).active;
2319+
for( const auto& k : auth.get_addresses() )
2320+
result.insert( k );
23212321
return &auth;
23222322
};
2323-
auto get_owner = [this, &result](account_id_type id) {
2324-
const auto& auth = id(_db).owner;
2323+
auto get_owner = [this, &result]( account_id_type id ) {
2324+
const auto& auth = id( _db ).owner;
23252325
for (const auto& k : auth.get_addresses())
2326-
result.insert(k);
2326+
result.insert( k );
23272327
return &auth;
23282328
};
23292329

2330-
trx.get_required_signatures(_db.get_chain_id(),
2331-
flat_set<public_key_type>(),
2332-
get_active, get_owner,
2333-
allow_non_immediate_owner,
2334-
ignore_custom_op_reqd_auths,
2335-
_db.get_global_properties().parameters.max_authority_depth);
2330+
trx.get_required_signatures( _db.get_chain_id(),
2331+
flat_set<public_key_type>(),
2332+
get_active, get_owner,
2333+
allow_non_immediate_owner,
2334+
ignore_custom_op_reqd_auths,
2335+
_db.get_global_properties().parameters.max_authority_depth );
23362336
return result;
23372337
}
23382338

libraries/chain/db_notify.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ struct get_impacted_account_visitor
2727
flat_set<account_id_type>& _impacted;
2828
bool _ignore_custom_op_reqd_auths;
2929

30-
get_impacted_account_visitor(flat_set<account_id_type>& impact, bool ignore_custom_operation_required_auths)
31-
: _impacted(impact), _ignore_custom_op_reqd_auths(ignore_custom_operation_required_auths)
30+
get_impacted_account_visitor( flat_set<account_id_type>& impact, bool ignore_custom_operation_required_auths )
31+
: _impacted( impact ), _ignore_custom_op_reqd_auths( ignore_custom_operation_required_auths )
3232
{}
3333

3434
using result_type = void;
@@ -158,10 +158,10 @@ struct get_impacted_account_visitor
158158
{
159159
_impacted.insert( op.fee_payer() ); // fee_paying_account
160160
vector<authority> other;
161-
for (const auto& proposed_op : op.proposed_ops)
162-
operation_get_required_authorities(proposed_op.op, _impacted, _impacted, other, _ignore_custom_op_reqd_auths);
163-
for (auto& o : other)
164-
add_authority_accounts(_impacted, o);
161+
for( const auto& proposed_op : op.proposed_ops )
162+
operation_get_required_authorities( proposed_op.op, _impacted, _impacted, other, _ignore_custom_op_reqd_auths );
163+
for( auto& o : other )
164+
add_authority_accounts( _impacted, o );
165165
}
166166
void operator()( const proposal_update_operation& op )
167167
{
@@ -218,9 +218,9 @@ struct get_impacted_account_visitor
218218
}
219219
void operator()( const custom_operation& op )
220220
{
221-
_impacted.insert(op.fee_payer()); // payer
222-
if (!_ignore_custom_op_reqd_auths)
223-
_impacted.insert(op.required_auths.begin(), op.required_auths.end());
221+
_impacted.insert( op.fee_payer() ); // payer
222+
if( !_ignore_custom_op_reqd_auths )
223+
_impacted.insert( op.required_auths.begin(), op.required_auths.end() );
224224
}
225225
void operator()( const assert_operation& op )
226226
{
@@ -290,17 +290,17 @@ struct get_impacted_account_visitor
290290
}
291291
};
292292

293-
void graphene::chain::operation_get_impacted_accounts(const operation& op, flat_set<account_id_type>& result, bool ignore_custom_operation_required_auths) {
294-
get_impacted_account_visitor vtor = get_impacted_account_visitor(result, ignore_custom_operation_required_auths);
295-
op.visit(vtor);
293+
void graphene::chain::operation_get_impacted_accounts( const operation& op, flat_set<account_id_type>& result, bool ignore_custom_operation_required_auths ) {
294+
get_impacted_account_visitor vtor = get_impacted_account_visitor( result, ignore_custom_operation_required_auths );
295+
op.visit( vtor );
296296
}
297297

298-
void graphene::chain::transaction_get_impacted_accounts(const transaction& tx, flat_set<account_id_type>& result, bool ignore_custom_operation_required_auths) {
299-
for (const auto& op : tx.operations)
300-
operation_get_impacted_accounts(op, result, ignore_custom_operation_required_auths);
298+
void graphene::chain::transaction_get_impacted_accounts( const transaction& tx, flat_set<account_id_type>& result, bool ignore_custom_operation_required_auths ) {
299+
for( const auto& op : tx.operations )
300+
operation_get_impacted_accounts( op, result, ignore_custom_operation_required_auths );
301301
}
302302

303-
void get_relevant_accounts(const object* obj, flat_set<account_id_type>& accounts, bool ignore_custom_operation_required_auths) {
303+
void get_relevant_accounts( const object* obj, flat_set<account_id_type>& accounts, bool ignore_custom_operation_required_auths ) {
304304
if( obj->id.space() == protocol_ids )
305305
{
306306
switch( (object_type)obj->id.type() )
@@ -346,14 +346,14 @@ void get_relevant_accounts(const object* obj, flat_set<account_id_type>& account
346346
} case proposal_object_type:{
347347
const auto& aobj = dynamic_cast<const proposal_object*>(obj);
348348
FC_ASSERT( aobj != nullptr );
349-
transaction_get_impacted_accounts(aobj->proposed_transaction, accounts,
350-
ignore_custom_operation_required_auths);
349+
transaction_get_impacted_accounts( aobj->proposed_transaction, accounts,
350+
ignore_custom_operation_required_auths );
351351
break;
352352
} case operation_history_object_type:{
353353
const auto& aobj = dynamic_cast<const operation_history_object*>(obj);
354354
FC_ASSERT( aobj != nullptr );
355-
operation_get_impacted_accounts(aobj->op, accounts,
356-
ignore_custom_operation_required_auths);
355+
operation_get_impacted_accounts( aobj->op, accounts,
356+
ignore_custom_operation_required_auths );
357357
break;
358358
} case withdraw_permission_object_type:{
359359
const auto& aobj = dynamic_cast<const withdraw_permission_object*>(obj);
@@ -410,8 +410,8 @@ void get_relevant_accounts(const object* obj, flat_set<account_id_type>& account
410410
} case impl_transaction_history_object_type:{
411411
const auto& aobj = dynamic_cast<const transaction_history_object*>(obj);
412412
FC_ASSERT( aobj != nullptr );
413-
transaction_get_impacted_accounts(aobj->trx, accounts,
414-
ignore_custom_operation_required_auths);
413+
transaction_get_impacted_accounts( aobj->trx, accounts,
414+
ignore_custom_operation_required_auths );
415415
break;
416416
} case impl_blinded_balance_object_type:{
417417
const auto& aobj = dynamic_cast<const blinded_balance_object*>(obj);
@@ -517,7 +517,7 @@ void database::notify_changed_objects()
517517
}
518518

519519
if( removed_ids.size() )
520-
GRAPHENE_TRY_NOTIFY(removed_objects, removed_ids, removed, removed_accounts_impacted)
520+
GRAPHENE_TRY_NOTIFY( removed_objects, removed_ids, removed, removed_accounts_impacted )
521521
}
522522
}
523523
} FC_CAPTURE_AND_LOG( (0) ) }

libraries/chain/include/graphene/chain/impacted.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030

3131
namespace graphene { namespace chain {
3232

33-
void operation_get_impacted_accounts(const graphene::chain::operation& op,
34-
fc::flat_set<graphene::chain::account_id_type>& result,
35-
bool ignore_custom_operation_required_auths);
33+
void operation_get_impacted_accounts( const graphene::chain::operation& op,
34+
fc::flat_set<graphene::chain::account_id_type>& result,
35+
bool ignore_custom_operation_required_auths );
3636

37-
void transaction_get_impacted_accounts(const graphene::chain::transaction& tx,
38-
fc::flat_set<graphene::chain::account_id_type>& result,
39-
bool ignore_custom_operation_required_auths);
37+
void transaction_get_impacted_accounts( const graphene::chain::transaction& tx,
38+
fc::flat_set<graphene::chain::account_id_type>& result,
39+
bool ignore_custom_operation_required_auths );
4040

4141
} } // graphene::app

0 commit comments

Comments
 (0)