Skip to content

Commit

Permalink
remove old model from cmake (hyperledger-iroha#1222)
Browse files Browse the repository at this point in the history
* remove old model from cmake

Signed-off-by: Alexey Chernyshov <[email protected]>
  • Loading branch information
Alexey-N-Chernyshov authored Apr 19, 2018
1 parent ec16af8 commit f8c7643
Show file tree
Hide file tree
Showing 23 changed files with 40 additions and 61 deletions.
3 changes: 1 addition & 2 deletions irohad/ametsuchi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ add_library(ametsuchi
)

target_link_libraries(ametsuchi
json_model_converters
logger
rxcpp
pqxx
libs_common
command_execution
boost
model_interfaces
shared_model_interfaces
shared_model_proto_backend
shared_model_proto_builders
shared_model_stateless_validation
Expand Down
2 changes: 1 addition & 1 deletion irohad/consensus/yac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_library(supermajority_check
impl/supermajority_checker_impl.cpp
)
target_link_libraries(supermajority_check
model
shared_model_interfaces
)

add_library(yac
Expand Down
3 changes: 1 addition & 2 deletions irohad/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ target_link_libraries(server_runner

add_library(raw_block_loader impl/raw_block_loader.cpp)
target_link_libraries(raw_block_loader
model_interfaces
shared_model_interfaces
)

add_library(application
Expand All @@ -39,7 +39,6 @@ target_link_libraries(application
logger
yac
server_runner
model
ametsuchi
networking
ordering_service
Expand Down
1 change: 0 additions & 1 deletion irohad/main/irohad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <csignal>
#include <fstream>
#include <thread>
#include "backend/protobuf/from_old_model.hpp"
#include "common/result.hpp"
#include "crypto/keys_manager_impl.hpp"
#include "main/application.hpp"
Expand Down
5 changes: 2 additions & 3 deletions irohad/network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_library(networking

target_link_libraries(networking
rxcpp
model
shared_model_interfaces
ordering_service
synchronizer
logger
Expand All @@ -15,10 +15,9 @@ add_library(block_loader
)

target_link_libraries(block_loader
pb_model_converters
loader_grpc
rxcpp
model
shared_model_interfaces
)

add_library(block_loader_service
Expand Down
2 changes: 0 additions & 2 deletions irohad/network/impl/block_loader_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "ametsuchi/block_query.hpp"
#include "loader.grpc.pb.h"
#include "logger/logger.hpp"
#include "model/converters/pb_block_factory.hpp"

namespace iroha {
namespace network {
Expand All @@ -40,7 +39,6 @@ namespace iroha {
protocol::Block *response) override;

private:
model::converters::PbBlockFactory factory_;
std::shared_ptr<ametsuchi::BlockQuery> storage_;
logger::Logger log_;
};
Expand Down
1 change: 0 additions & 1 deletion irohad/network/impl/peer_communication_service_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ limitations under the License.
*/

#include "network/impl/peer_communication_service_impl.hpp"
#include "backend/protobuf/from_old_model.hpp"

namespace iroha {
namespace network {
Expand Down
3 changes: 1 addition & 2 deletions irohad/ordering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ add_library(ordering_service


target_link_libraries(ordering_service
pb_model_converters
rxcpp
tbb
model
shared_model_interfaces
ordering_grpc
logger
)
2 changes: 1 addition & 1 deletion irohad/simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_library(simulator
)

target_link_libraries(simulator
model
shared_model_proto_backend
rxcpp
logger
)
2 changes: 1 addition & 1 deletion irohad/synchronizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_library(synchronizer
)

target_link_libraries(synchronizer
model
shared_model_interfaces
rxcpp
logger
)
12 changes: 5 additions & 7 deletions irohad/torii/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ add_library(command_client command_client.cpp)
target_link_libraries(command_client
torii_service
endpoint
model
schema
)

target_link_libraries(query_client
torii_service
endpoint
)
torii_service
endpoint
)

add_library(torii_service
impl/query_service.cpp
impl/command_service.cpp
)
target_link_libraries(torii_service
pb_model_converters
endpoint
model
shared_model_proto_backend
logger
shared_model_stateless_validation
)
5 changes: 2 additions & 3 deletions irohad/validation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ add_library(stateful_validator
)
target_link_libraries(stateful_validator
rxcpp
model
model_interfaces
shared_model_interfaces
logger
)

add_library(chain_validator
impl/chain_validator_impl.cpp)
target_link_libraries(chain_validator
rxcpp
model
shared_model_interfaces
logger
supermajority_check
)
2 changes: 1 addition & 1 deletion shared_model/backend/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ add_library(shared_model_proto_backend

target_link_libraries(shared_model_proto_backend
schema
model_interfaces
shared_model_interfaces
iroha_amount
)
1 change: 1 addition & 0 deletions shared_model/builders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ add_library(shared_model_default_builders INTERFACE)

target_link_libraries(shared_model_default_builders INTERFACE
shared_model_proto_builders
shared_model_stateless_validation
)
2 changes: 1 addition & 1 deletion shared_model/builders/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ add_library(shared_model_proto_builders

target_link_libraries(
shared_model_proto_builders
model_interfaces
shared_model_interfaces
shared_model_proto_backend
)
4 changes: 2 additions & 2 deletions shared_model/interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_library(model_interfaces
add_library(shared_model_interfaces
impl.cpp
)

target_link_libraries(model_interfaces
target_link_libraries(shared_model_interfaces
old_model
shared_model_cryptography
${Boost_LIBRARIES}
Expand Down
2 changes: 1 addition & 1 deletion shared_model/validators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ add_library(shared_model_stateless_validation

target_link_libraries(shared_model_stateless_validation
schema
model_interfaces
shared_model_interfaces
)
10 changes: 5 additions & 5 deletions test/integration/acceptance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ target_link_libraries(create_account_test

addtest(tx_heavy_data tx_heavy_data.cpp)
target_link_libraries(tx_heavy_data
application
integration_framework
shared_model_proto_builders
shared_model_stateless_validation
)
application
integration_framework
shared_model_proto_builders
shared_model_stateless_validation
)
25 changes: 6 additions & 19 deletions test/module/irohad/consensus/yac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,33 @@ target_link_libraries(cluster_order_test
addtest(yac_cold_case_test yac_simple_cold_case_test.cpp)
target_link_libraries(yac_cold_case_test
yac
model
shared_model_cryptography_model
)

addtest(yac_sunny_day_test yac_sunny_day_test.cpp)
target_link_libraries(yac_sunny_day_test
yac
model
shared_model_cryptography_model
)

addtest(yac_rainy_day_test yac_rainy_day_test.cpp)
target_link_libraries(yac_rainy_day_test
yac
model
shared_model_cryptography_model
)

addtest(yac_unknown_peer_test yac_unknown_peer_test.cpp)
target_link_libraries(yac_unknown_peer_test
yac
model
shared_model_stateless_validation
)

addtest(yac_block_storage_test yac_block_storage_test.cpp)
target_link_libraries(yac_block_storage_test
yac
model
shared_model_cryptography_model
)

addtest(yac_proposal_storage_test yac_proposal_storage_test.cpp)
target_link_libraries(yac_proposal_storage_test
yac
model
shared_model_stateless_validation
)

addtest(yac_timer_test timer_test.cpp)
Expand All @@ -72,23 +62,22 @@ target_link_libraries(yac_timer_test
addtest(yac_network_test network_test.cpp)
target_link_libraries(yac_network_test
yac
model
shared_model_stateless_validation
shared_model_interfaces
shared_model_default_builders
)

addtest(yac_peer_orderer_test peer_orderer_test.cpp)
target_link_libraries(yac_peer_orderer_test
yac
shared_model_stateless_validation
model
shared_model_interfaces
shared_model_default_builders
)

addtest(yac_gate_test yac_gate_test.cpp)
target_link_libraries(yac_gate_test
yac
model
shared_model_cryptography_model
shared_model_stateless_validation
shared_model_default_builders
)

addtest(yac_hash_provider_test yac_hash_provider_test.cpp)
Expand All @@ -106,13 +95,11 @@ target_link_libraries(yac_common_test
addtest(yac_crypto_provider_test yac_crypto_provider_test.cpp)
target_link_libraries(yac_crypto_provider_test
yac
model
shared_model_cryptography_model
shared_model_stateless_validation
shared_model_default_builders
)

addtest(supermajority_checker_test supermajority_checker_test.cpp)
target_link_libraries(supermajority_checker_test
yac
model
)
1 change: 0 additions & 1 deletion test/module/irohad/consensus/yac/peer_orderer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "consensus/yac/storage/yac_proposal_storage.hpp"
#include "module/irohad/ametsuchi/ametsuchi_mocks.hpp"
#include "module/irohad/consensus/yac/yac_mocks.hpp"
#include "validators/field_validator.hpp"

using namespace boost::adaptors;
using namespace iroha::ametsuchi;
Expand Down
2 changes: 1 addition & 1 deletion test/module/irohad/validation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

addtest(query_execution query_execution.cpp)
target_link_libraries(query_execution
model
shared_model_interfaces
shared_model_stateless_validation
)

Expand Down
2 changes: 1 addition & 1 deletion test/system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addtest(irohad_test irohad_test.cpp)
target_link_libraries(irohad_test
boost
pqxx
json_model_converters
rapidjson
integration_framework_config_helper
libs_common
)
Expand Down
9 changes: 6 additions & 3 deletions test/system/irohad_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include <gtest/gtest.h>
#include <rapidjson/document.h>
#include <rapidjson/prettywriter.h>
#include <rapidjson/stringbuffer.h>
#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
#include <boost/process.hpp>
Expand All @@ -30,7 +32,6 @@
#undef RAPIDJSON_HAS_STDSTRING

#include "framework/config_helper.hpp"
#include "model/converters/json_common.hpp"

using namespace boost::process;
using namespace boost::filesystem;
Expand All @@ -52,8 +53,10 @@ class IrohadTest : public testing::Test {
auto config_copy_json = parse_iroha_config(path_config_.string());
config_copy_json[config_members::PgOpt].SetString(pgopts_.data(),
pgopts_.size());
auto config_copy_string =
iroha::model::converters::jsonToString(config_copy_json);
rapidjson::StringBuffer sb;
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(sb);
config_copy_json.Accept(writer);
std::string config_copy_string = sb.GetString();
std::ofstream copy_file(config_copy_);
copy_file.write(config_copy_string.data(), config_copy_string.size());
}
Expand Down

0 comments on commit f8c7643

Please sign in to comment.