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

Database_api code refactory #1891

Merged
merged 6 commits into from
Aug 15, 2019
Merged

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Aug 9, 2019

Changes:

  • Rename full_account.hpp to api_objects.hpp
  • Move API-relate objects from database_api.* into api_objects.*
  • Move a util functions price_to_string() from database_api.* to util.*
  • Create database_api_imp.hxx and move definition of database_api_impl class into it
  • Move code around
  • Wrap long lines

Putting this in 3.3 release so far, please feel free to move out if it's not appropriate.

@abitmore abitmore added this to the 3.3.0 - Feature Release milestone Aug 9, 2019
@oxarbitrage
Copy link
Member

Nice stuff, in the right direction.

For continuation in new lines of functions with arguments i personally prefer to use double indentation(6 spaces in our codebase) as sometimes the namespace, type, name, etc can be so long that you will have little space to place the arguments if you place them one below the other aligned. I see you applied some of that in some cases(where you didn't had another option) with more than 6 spaces. 6 spaces will kind of work always, if more then 2 lines are needed i do something like:

vector<operation_history_object> elasticsearch_plugin::get_account_history(
const account_id_type account_id,
operation_history_id_type stop = operation_history_id_type(),
unsigned limit = 100,
operation_history_id_type start = operation_history_id_type())

@abitmore abitmore changed the base branch from pr-1819-subscription to develop August 14, 2019 16:26
@abitmore abitmore force-pushed the pr-database-api-code-refactory branch from c7d657a to fa42e70 Compare August 14, 2019 18:04
@abitmore
Copy link
Member Author

Rebased to latest develop branch.

@oxarbitrage oxarbitrage self-requested a review August 14, 2019 19:39
libraries/app/api_objects.cpp Outdated Show resolved Hide resolved
libraries/app/database_api.cpp Outdated Show resolved Hide resolved
libraries/app/database_api.cpp Show resolved Hide resolved
libraries/app/database_api.cpp Outdated Show resolved Hide resolved
libraries/app/database_api_impl.hxx Outdated Show resolved Hide resolved
@abitmore abitmore force-pushed the pr-database-api-code-refactory branch from 98de678 to d51305c Compare August 15, 2019 12:33
@abitmore
Copy link
Member Author

Updated text about copyright and force-pushed to avoid having confusing copyright changes in history.

Updated includes, built fine with GCC5.4 in Ubuntu 16.04, not sure whether there would be issue on other platforms.

@abitmore abitmore force-pushed the pr-database-api-code-refactory branch from d51305c to 62fc622 Compare August 15, 2019 13:36
@oxarbitrage oxarbitrage merged commit 34509f8 into develop Aug 15, 2019
@abitmore abitmore deleted the pr-database-api-code-refactory branch August 15, 2019 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants