Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Alekseev <[email protected]>

# Conflicts:
#	test/module/shared_model/backend_proto/CMakeLists.txt
  • Loading branch information
nickaleks committed Jul 18, 2018
1 parent 257ebe9 commit c436031
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/postgres_wsv_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include "ametsuchi/impl/postgres_wsv_command.hpp"

#include <boost/format.hpp>

#include "backend/protobuf/permissions.hpp"
#include "interfaces/common_objects/asset.hpp"
#include "interfaces/common_objects/account_asset.hpp"

namespace iroha {
namespace ametsuchi {
Expand Down
21 changes: 2 additions & 19 deletions irohad/ametsuchi/impl/postgres_wsv_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,6 @@ namespace iroha {
return values;
}

/**
* Execute build function and return error in case it throws
* @tparam T - result value type
* @param f - function which returns BuilderResult
* @return whatever f returns, or error in case exception has been thrown
*/
// template <typename BuildFunc>
// static inline auto tryBuild(BuildFunc &&f) noexcept -> decltype(f()) {
// try {
// return f();
// } catch (std::exception &e) {
// return
// expected::makeError(std::make_shared<std::string>(e.what()));
// }
// }

template <typename ParamType, typename Function>
void processSoci(soci::statement &st,
soci::indicator &ind,
Expand Down Expand Up @@ -99,9 +83,8 @@ namespace iroha {
shared_model::interface::CommonObjectsFactory::FactoryResult<
std::unique_ptr<T>> &&result) {
return result.match(
[](expected::Value<std::unique_ptr<T>> &v)
-> boost::optional<std::shared_ptr<T>> {
return std::shared_ptr<T>(std::move(v.value));
[](expected::Value<std::unique_ptr<T>> &v) {
return boost::make_optional(std::shared_ptr<T>(std::move(v.value)));
},
[](expected::Error<std::string>)
-> boost::optional<std::shared_ptr<T>> { return boost::none; });
Expand Down
2 changes: 0 additions & 2 deletions irohad/ametsuchi/impl/postgres_wsv_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

#include "ametsuchi/wsv_query.hpp"

#include <soci/soci.h>

#include "interfaces/common_objects/common_objects_factory.hpp"
#include "postgres_wsv_common.hpp"

Expand Down
3 changes: 0 additions & 3 deletions test/module/libs/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ addtest(result_test result_test.cpp)
target_link_libraries(result_test
libs_common
)

add_library(optional_test
optinal_test.cpp)

0 comments on commit c436031

Please sign in to comment.