Skip to content

Commit

Permalink
Fix smart pointer on storage
Browse files Browse the repository at this point in the history
  • Loading branch information
muratovv committed Aug 2, 2017
1 parent 122895c commit 10c3376
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions irohad/ametsuchi/impl/storage_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace iroha {
std::move(wsv_transaction), std::move(wsv), std::move(executor));
}

std::unique_ptr<StorageImpl> StorageImpl::create(
std::shared_ptr<StorageImpl> StorageImpl::create(
std::string block_store_dir, std::string redis_host,
std::size_t redis_port, std::string postgres_options) {
// TODO lock
Expand Down Expand Up @@ -150,7 +150,7 @@ namespace iroha {
std::unique_ptr<WsvQuery> wsv =
std::make_unique<PostgresWsvQuery>(*wsv_transaction);

return std::unique_ptr<StorageImpl>(
return std::shared_ptr<StorageImpl>(
new StorageImpl(block_store_dir, redis_host, redis_port,
postgres_options, std::move(block_store),
std::move(index), std::move(postgres_connection),
Expand Down
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/storage_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace iroha {
namespace ametsuchi {
class StorageImpl : public Storage {
public:
static std::unique_ptr<StorageImpl> create(
static std::shared_ptr<StorageImpl> create(
std::string block_store_dir, std::string redis_host,
std::size_t redis_port, std::string postgres_connection);
std::unique_ptr<TemporaryWsv> createTemporaryWsv() override;
Expand Down
2 changes: 1 addition & 1 deletion irohad/main/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Irohad {
std::string pg_conn_;

public:
std::unique_ptr<iroha::ametsuchi::StorageImpl> storage; // FIXME when integration
std::shared_ptr<iroha::ametsuchi::StorageImpl> storage;
};

#endif // IROHA_APPLICATION_HPP

0 comments on commit 10c3376

Please sign in to comment.