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

Add an adaptor to es_objects and template function to reduce code #1429

Merged
merged 4 commits into from
Dec 19, 2018

Conversation

oxarbitrage
Copy link
Member

The following pull request is an attempt to reduce the amount of code in the es_objects plugin and make it easier to add new objects. It uses an adaptor approach very similar to the one used in elasticsearch plugin for account history, this time for objects.

I think more can be done, specifically there is duplicated code in index_database function that i tried to reduce however i was not able to make it due to casting, types, etc.

I opted on submitting this changes as i think they go in the right direction, as i don't know exactly when i will have the time to work on this again i preferred to submit what i have now and don't let the code lost.

This is a refactor, users can continue using this plugin the same way they were doing before without changes in the options however i am considering it will be better to add the objects the user want to save in a vector instead of individual options for each as it is now.

In initial testings i was able to sync without any error up to 2016-05-10T02:10:30 with everything turned on(all objects) with command:

./programs/witness_node/witness_node --plugins "es_objects" --es-objects-proposals "true" --es-objects-accounts "true" --es-objects-assets "true" --es-objects-balances "true" --es-objects-limit-orders "true" --es-objects-asset-bitasset "true"

@oxarbitrage oxarbitrage added code cleanup 6 Plugin Impact flag identifying at least one plugin labels Nov 10, 2018
pmconrad
pmconrad previously approved these changes Dec 14, 2018
Copy link
Contributor

@pmconrad pmconrad left a comment

Choose a reason for hiding this comment

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

Looks like an improvement.
Haven't tested it myself, but it's an experimental plugin so if it works for you it should be ok.

@oxarbitrage
Copy link
Member Author

thank you @pmconrad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 Plugin Impact flag identifying at least one plugin code cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants