bitshares-core icon indicating copy to clipboard operation
bitshares-core copied to clipboard

Add the query_txid_plugin as a option on the develop branch

Open bijianing97 opened this issue 5 years ago • 10 comments

The pull request is the solution for the #1954, I rebased on the current develop.

bijianing97 avatar Aug 23 '19 08:08 bijianing97

ok,I will fix them and should I create a new pull request?

bijianing97 avatar Aug 26 '19 02:08 bijianing97

I have fixed the above questions and hope you will like it.

bijianing97 avatar Aug 26 '19 06:08 bijianing97

Thank you @bijianing97. Looking good.

I noticed that the new plugin files like https://github.com/bitshares/bitshares-core/blob/32ba6bbf1f2ee9b7b781ac7bf53d2eeae1c01cbf/libraries/plugins/query_txid/query_txid_plugin.cpp the indentation is 4 spaces while the Bitshares project use 3 (almost) everywhere. Will be good if you can change these.

I sent also a few more comments. Adding more commits into this pull request is fine and what you should do, by now your commits have all the same name. Will be good if next ones haves a more descriptive name at least to differentiate them.

Overall great work, i am downloading the requirements and testing further. Will send some more comments once there.

oxarbitrage avatar Aug 26 '19 21:08 oxarbitrage

OK,I will try to keep it in few days because i have other work to do

bijianing97 avatar Aug 28 '19 12:08 bijianing97

There are some compiler warnings about signed/unsigned comparisons that i think it should be easy to remove:

[ 64%] Building CXX object libraries/plugins/query_txid/CMakeFiles/graphene_query_txid.dir/query_txid_plugin.cpp.o
/home/oxarbitrage/CLionProjects/pull1957/bitshares-core/libraries/plugins/query_txid/query_txid_plugin.cpp: In member function ‘void graphene::query_txid::detail::query_txid_plugin_impl::collect_txid_index(const graphene::protocol::signed_block&)’:
/home/oxarbitrage/CLionProjects/pull1957/bitshares-core/libraries/plugins/query_txid/query_txid_plugin.cpp:102:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (auto idx = 0; idx < b.transactions.size(); idx++) {
                          ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/oxarbitrage/CLionProjects/pull1957/bitshares-core/libraries/plugins/query_txid/query_txid_plugin.cpp: In member function ‘void graphene::query_txid::detail::query_txid_plugin_impl::consume_block()’:
/home/oxarbitrage/CLionProjects/pull1957/bitshares-core/libraries/plugins/query_txid/query_txid_plugin.cpp:128:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       while (number > limit_batch) {
              ~~~~~~~^~~~~~~~~~~~~
/home/oxarbitrage/CLionProjects/pull1957/bitshares-core/libraries/plugins/query_txid/query_txid_plugin.cpp:131:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          for (auto idx = 0; idx < limit_batch; idx++) {
                             ~~~~^~~~~~~~~~~~~
/home/oxarbitrage/CLionProjects/pull1957/bitshares-core/libraries/plugins/query_txid/query_txid_plugin.cpp:149:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (backupnum > limit_batch)
           ~~~~~~~~~~^~~~~~~~~~~~~
[ 64%] Linking CXX static library libgraphene_query_txid.a
[ 64%] Built target graphene_query_txid

oxarbitrage avatar Aug 28 '19 13:08 oxarbitrage

I modify some variables from signed to unsigned and do not get warning about that.And show the hint about query_txid like the UES_PROFILER.

bijianing97 avatar Aug 30 '19 03:08 bijianing97

ok, i fixed it.

bijianing97 avatar Aug 30 '19 13:08 bijianing97

I add the plugin to .travis.yml and Dockerfile ,but failed in the docker ,i can’t see the details and modify it

bijianing97 avatar Sep 05 '19 05:09 bijianing97

but failed in the docker ,i can’t see the details and modify it

Currently it fails because the container doesn't have wget. But it makes no sense to implement this blindly, if you don't have a local docker installation for testing you can leave it out.

pmconrad avatar Sep 05 '19 06:09 pmconrad

I'm sorry that I don't know how to add some unit tests, could you give me some example, I will try to do it in few days.

bijianing97 avatar Sep 06 '19 10:09 bijianing97