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

Remove duplicated code #7

Open
oxarbitrage opened this issue Dec 30, 2018 · 1 comment
Open

Remove duplicated code #7

oxarbitrage opened this issue Dec 30, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@oxarbitrage
Copy link

The get_relevant_accounts function is duplicated, present in api.cpp and in db_notify.cpp.

The one in db_notify produces some warnings of types not being handled in switch statements:

/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp: In function ‘void get_relevant_accounts(const graphene::db::object*, boost::container::flat_set<graphene::db::object_id<1u, 2u, graphene::chain::account_object> >&)’:
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘tournament_object_type’ not handled in switch [-Wswitch]
       switch( (object_type)obj->id.type() )
             ^
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘tournament_details_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘match_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘game_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘sport_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘event_group_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘event_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘betting_market_rules_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘betting_market_group_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘betting_market_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:290:13: warning: enumeration value ‘bet_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:365:13: warning: enumeration value ‘impl_asset_dividend_data_type’ not handled in switch [-Wswitch]
       switch( (impl_object_type)obj->id.type() )
             ^
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:365:13: warning: enumeration value ‘impl_pending_dividend_payout_balance_for_holder_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:365:13: warning: enumeration value ‘impl_distributed_dividend_balance_data_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:365:13: warning: enumeration value ‘impl_betting_market_position_object_type’ not handled in switch [-Wswitch]
/home/alfredo/CLionProjects/gpos/libraries/chain/db_notify.cpp:365:13: warning: enumeration value ‘impl_global_betting_statistics_object_type’ not handled in switch [-Wswitch]

Either we:

  • keep api.cpp and remove db_notify.cpp one.
  • add missing types to db_notify.cpp and remove the one in api.cpp, call notify function from api.
@xeroc
Copy link

xeroc commented Feb 21, 2019

I prefer the second option :D

@bobinson bobinson added the enhancement New feature or request label Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants