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 redundant config_file parameter of fetch_object #1167

Merged
merged 2 commits into from Dec 31, 2018

Conversation

Projects
3 participants
@tiendq
Copy link
Contributor

commented Sep 10, 2018

rai::fetch_object doesn't need config_file parameter, config_file is only used inside this function, carries no input/output.

Close #1143

@rkeene rkeene added this to the V18.0 milestone Sep 10, 2018

@rkeene

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2018

There are a few issues with this changeset:

  1. Very minor formatting issue related to a blank line with trailing space;
  2. It fails to compile cleanly
[ 99%] Building CXX object rai/core_test/CMakeFiles/core_test.dir/work_pool.cpp.o
cd /workspace/build/rai/core_test && ccache /usr/bin/c++   -DACTIVE_NETWORK=rai_test_network -DBOOST_ASIO_HAS_STD_ARRAY=1 -DED25519_CUSTOMHASH -DED25519_CUSTOMRNG -DQT_NO_KEYWORDS -DRAIBLOCKS_VERSION_MAJOR=17 -DRAIBLOCKS_VERSION_MINOR=0 -I/workspace -isystem /usr/local/include -I/workspace/miniupnp/miniupnpc -I/workspace/phc-winner-argon2/include -I/workspace/phc-winner-argon2/src -I/workspace/blake2 -I/workspace/gtest/include  -g -fPIE   -Werror=switch -msse2 -std=gnu++14 -o CMakeFiles/core_test.dir/work_pool.cpp.o -c /workspace/rai/core_test/work_pool.cpp
/workspace/rai/rai_wallet/entry.cpp: In function 'bool {anonymous}::update_config(qt_wallet_config&, const boost::filesystem::path&, std::fstream&)':
/workspace/rai/rai_wallet/entry.cpp:175:64: error: no matching function for call to 'fetch_object(qt_wallet_config&, const boost::filesystem::path&, std::fstream&)'
  if (!rai::fetch_object (config_a, config_path_a, config_file_a))
                                                                ^
In file included from /workspace/rai/node/rpc.hpp:8:0,
                 from /workspace/rai/rai_wallet/entry.cpp:2:
/workspace/rai/secure/utility.hpp:34:6: note: candidate: template<class T> bool rai::fetch_object(T&, std::iostream&)
 bool fetch_object (T & object, std::iostream & stream_a)
      ^
/workspace/rai/secure/utility.hpp:34:6: note:   template argument deduction/substitution failed:
/workspace/rai/rai_wallet/entry.cpp:175:64: note:   cannot convert 'config_path_a' (type 'const boost::filesystem::path') to type 'std::iostream& {aka std::basic_iostream<char>&}'
  if (!rai::fetch_object (config_a, config_path_a, config_file_a))
                                                                ^
In file included from /workspace/rai/node/rpc.hpp:8:0,
                 from /workspace/rai/rai_wallet/entry.cpp:2:
/workspace/rai/secure/utility.hpp:61:6: note: candidate: template<class T> bool rai::fetch_object(T&, const boost::filesystem::path&)
 bool fetch_object (T & object, boost::filesystem::path const & path_a)
      ^
/workspace/rai/secure/utility.hpp:61:6: note:   template argument deduction/substitution failed:
/workspace/rai/rai_wallet/entry.cpp:175:64: note:   candidate expects 2 arguments, 3 provided
  if (!rai::fetch_object (config_a, config_path_a, config_file_a))
                                                                ^
/workspace/rai/rai_wallet/entry.cpp: In function 'int run_wallet(QApplication&, int, char* const*, const boost::filesystem::path&)':
/workspace/rai/rai_wallet/entry.cpp:204:65: error: no matching function for call to 'fetch_object(qt_wallet_config&, boost::filesystem::path&, std::fstream&)'
  auto error (rai::fetch_object (config, config_path, config_file));
                                                                 ^
In file included from /workspace/rai/node/rpc.hpp:8:0,
                 from /workspace/rai/rai_wallet/entry.cpp:2:
/workspace/rai/secure/utility.hpp:34:6: note: candidate: template<class T> bool rai::fetch_object(T&, std::iostream&)
 bool fetch_object (T & object, std::iostream & stream_a)
      ^
/workspace/rai/secure/utility.hpp:34:6: note:   template argument deduction/substitution failed:
/workspace/rai/rai_wallet/entry.cpp:204:65: note:   cannot convert 'config_path' (type 'boost::filesystem::path') to type 'std::iostream& {aka std::basic_iostream<char>&}'
  auto error (rai::fetch_object (config, config_path, config_file));
                                                                 ^
In file included from /workspace/rai/node/rpc.hpp:8:0,
                 from /workspace/rai/rai_wallet/entry.cpp:2:
/workspace/rai/secure/utility.hpp:61:6: note: candidate: template<class T> bool rai::fetch_object(T&, const boost::filesystem::path&)
 bool fetch_object (T & object, boost::filesystem::path const & path_a)
      ^
/workspace/rai/secure/utility.hpp:61:6: note:   template argument deduction/substitution failed:
/workspace/rai/rai_wallet/entry.cpp:204:65: note:   candidate expects 2 arguments, 3 provided
  auto error (rai::fetch_object (config, config_path, config_file));
                                                                 ^
CMakeFiles/nano_wallet.dir/build.make:94: recipe for target 'CMakeFiles/nano_wallet.dir/rai/rai_wallet/entry.cpp.o' failed

@tiendq tiendq force-pushed the tiendq:remove-configfile-param branch from 5ff260c to c457c26 Sep 11, 2018

@tiendq

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2018

@rkeene Fixed both

  1. Fixed
  2. I turned off wallet build option. Updated code, build successfully with wallet now.

@rkeene rkeene removed the incomplete label Sep 11, 2018

@clemahieu clemahieu requested a review from argakiig Dec 20, 2018

@zhyatt zhyatt added this to Unscheduled in V18 Dec 27, 2018

@zhyatt zhyatt moved this from Unscheduled to Unassigned in V18 Dec 27, 2018

@zhyatt zhyatt moved this from Unassigned to Unscheduled in V18 Dec 28, 2018

@rkeene rkeene force-pushed the tiendq:remove-configfile-param branch from c457c26 to 7d6c2de Dec 28, 2018

tiendq and others added some commits Sep 10, 2018

@argakiig argakiig moved this from Unscheduled to CP 0 in V18 Dec 29, 2018

@argakiig argakiig moved this from CP 0 to CP 1 (2018-01-09) in V18 Dec 29, 2018

@rkeene rkeene merged commit 52e545f into nanocurrency:master Dec 31, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.