Skip to content

Commit

Permalink
Remove some dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Drobny <[email protected]>
  • Loading branch information
vdrobnyi committed Jan 24, 2018
1 parent 52ef2bf commit 12375ec
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 30 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,9 @@ if(PACKAGE_TGZ OR PACKAGE_ZIP OR PACKAGE_RPM OR PACKAGE_DEB)
include(cmake/release.cmake)
endif()

set(SHARED_MODEL_DISABLE_COMPATIBILITY FALSE)
set(SHARED_MODEL_DISABLE_COMPATIBILITY TRUE)
if (SHARED_MODEL_DISABLE_COMPATIBILITY)
add_definitions(-DDISABLE_BACKWARD)
set(shared_model_ed25519_sha3_LIBRARY shared_model_ed25519_sha3)
else()
set(model_LIBRARY model)
endif()

add_subdirectory(schema)
Expand Down
1 change: 1 addition & 0 deletions irohad/consensus/yac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ target_link_libraries(yac
yac_grpc
logger
hash
pb_model_converters
)
8 changes: 4 additions & 4 deletions irohad/model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ target_link_libraries(command_execution
)

add_library(sha3_hash
sha3_hash.cpp
)
sha3_hash.cpp
)

target_link_libraries(sha3_hash
pb_model_converters
)
pb_model_converters
)

add_library(model
model_crypto_provider_impl.cpp
Expand Down
36 changes: 18 additions & 18 deletions irohad/model/sha3_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
#include "converters/pb_transaction_factory.hpp"

namespace iroha {
// TODO: remove factories
const static model::converters::PbTransactionFactory tx_factory;
const static model::converters::PbBlockFactory block_factory;
const static model::converters::PbQueryFactory query_factory;
// TODO: 24.01.2018 @victordrobny: remove factories IR-850
const static model::converters::PbTransactionFactory tx_factory;
const static model::converters::PbBlockFactory block_factory;
const static model::converters::PbQueryFactory query_factory;

hash256_t hash(const model::Transaction &tx) {
auto &&pb_dat = tx_factory.serialize(tx);
return hash(pb_dat);
}
hash256_t hash(const model::Transaction &tx) {
auto &&pb_dat = tx_factory.serialize(tx);
return hash(pb_dat);
}

hash256_t hash(const model::Block &block) {
auto &&pb_dat = block_factory.serialize(block);
return hash(pb_dat);
}
hash256_t hash(const model::Block &block) {
auto &&pb_dat = block_factory.serialize(block);
return hash(pb_dat);
}

hash256_t hash(const model::Query &query) {
std::shared_ptr<const model::Query> qptr(&query, [](auto) {});
auto &&pb_dat = query_factory.serialize(qptr);
return hash(*pb_dat);
}
}
hash256_t hash(const model::Query &query) {
std::shared_ptr<const model::Query> qptr(&query, [](auto) {});
auto &&pb_dat = query_factory.serialize(qptr);
return hash(*pb_dat);
}
}
3 changes: 3 additions & 0 deletions libs/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ add_library(keys_manager
)

target_link_libraries(keys_manager
# logger
optional
cryptography
pb_model_converters
# ${Boost_LIBRARIES}
)
8 changes: 8 additions & 0 deletions shared_model/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_library(old_model INTERFACE)

if (NOT SHARED_MODEL_DISABLE_COMPATIBILITY)
target_link_libraries(old_model INTERFACE
model
)
endif()

add_subdirectory(backend)
add_subdirectory(bindings)
add_subdirectory(builders)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ add_library(hash

target_link_libraries(hash
common
pb_model_converters
ed25519
)

Expand All @@ -30,6 +29,6 @@ add_library(cryptography
)

target_link_libraries(cryptography
ed25519
# ed25519
hash
)
4 changes: 2 additions & 2 deletions shared_model/interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ add_library(model_interfaces
)

target_link_libraries(model_interfaces
${model_LIBRARY}
${shared_model_ed25519_sha3_LIBRARY}
old_model
shared_model_ed25519_sha3
optional
rxcpp
${Boost_LIBRARIES}
Expand Down
1 change: 1 addition & 0 deletions test/module/shared_model/backend_proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ target_link_libraries(shared_proto_transaction_test
shared_model_proto_backend
shared_model_ed25519_sha3
shared_model_stateless_validation
iroha_amount
)

addtest(shared_proto_queries_test
Expand Down

0 comments on commit 12375ec

Please sign in to comment.