Skip to content
New issue

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

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

Already on GitHub? # to your account

refactor get_top_markets issue #842 #1549

Merged
merged 2 commits into from
Feb 5, 2019

Conversation

oxarbitrage
Copy link
Member

This is a replacement for pull request #1273 for issue #842.

Sorry i had to do it this way, the reason of the replacement is build problems at oxarbitrage:issue842 that i was not able to fix by merging the develop into the feature branch. Some issue with the websocket submodule.
Anyway, to avoid losing too much time on it i created this one that is almost the same(the last review comments were already addressed in #1273). On top of that, new pull modifies the method names according to our (not written yet) style guide: #1318 (comment)

Copy link
Contributor

@jmjatlanta jmjatlanta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes in the constructor may allow for in-place construction.

price latest_price = asset( mto.latest_base, mto.base ) / asset( mto.latest_quote, mto.quote );
if( mto.base != asset_base.id )
latest_price = ~latest_price;
latest = database_api_impl::price_to_string( latest_price, asset_base, asset_quote );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor suggestion (may be out of the scope of this ticket): put database_api_impl::price_to_string in some kind of common area. market_ticker should not have to know about database_api_impl, and database_api_impl::price_to_string shouldn't know about graphene::app::price_to_string.

libraries/app/database_api.cpp Outdated Show resolved Hide resolved
libraries/app/database_api.cpp Outdated Show resolved Hide resolved
libraries/app/database_api.cpp Outdated Show resolved Hide resolved
@abitmore
Copy link
Member

abitmore commented Feb 1, 2019

@jmjatlanta you may have interest in the first PR (#924) where we've addressed some issues. It's a pity that the code was abandoned.

@oxarbitrage
Copy link
Member Author

I had refactored to in-place constructor by comments from @jmjatlanta and by using parts of #924

@ryanRfox
Copy link
Contributor

ryanRfox commented Feb 5, 2019

@abitmore please have a look for Review of this PR. Thanks

@jmjatlanta
Copy link
Contributor

@jmjatlanta you may have interest in the first PR (#924) where we've addressed some issues. It's a pity that the code was abandoned.

Thanks. I took a look at it. This code looks very similar now. Is there something that you liked better in #924? Or is it just the fact that it was done twice?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants