Skip to content

Commit

Permalink
Fix macos build
Browse files Browse the repository at this point in the history
Signed-off-by: kamilsa <[email protected]>
  • Loading branch information
kamilsa authored and lebdron committed Dec 19, 2017
1 parent 97f8cd5 commit 3c58458
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
6 changes: 3 additions & 3 deletions shared_model/validators/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(stateles_validation
default_validator.hpp
add_library(shared_model_stateless_validation
default_validator.cpp
)

target_link_libraries(stateles_validation
target_link_libraries(shared_model_stateless_validation
schema
model_interfaces
)
3 changes: 2 additions & 1 deletion shared_model/validators/answer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef IROHA_ANSWER_HPP
#define IROHA_ANSWER_HPP

#include <boost/range/numeric.hpp>
#include <unordered_map>
#include "utils/string_builder.hpp"

Expand Down Expand Up @@ -64,7 +65,7 @@ namespace shared_model {
* Adds error to map
* @param reasons
*/
void addReason(ReasonsGroupType&& reasons){
void addReason(ReasonsGroupType &&reasons) {
reasons_map_.insert(std::move(reasons));
}

Expand Down
18 changes: 18 additions & 0 deletions shared_model/validators/default_validator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright Soramitsu Co., Ltd. 2017 All Rights Reserved.
* http://soramitsu.co.jp
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "default_validator.hpp"
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 @@ -35,6 +35,7 @@ addtest(shared_proto_transaction_test
target_link_libraries(shared_proto_transaction_test
shared_model_proto_backend
shared_model_ed25519_sha3
shared_model_stateless_validation
)

addtest(shared_proto_queries_test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ TEST(ProtoTransaction, BuilderWithInvalidTx) {
uint64_t created_time = 10000000000ull;
shared_model::interface::Transaction::TxCounterType tx_counter = 1;
std::string account_id = "admintest"; // account_id without @
std::string asset_id = "coin#test", // asset_id without #
std::string asset_id = "cointest", // asset_id without #
amount = "10.00";

iroha::protocol::Transaction proto_tx = generateEmptyTransaction();
Expand All @@ -139,11 +139,10 @@ TEST(ProtoTransaction, BuilderWithInvalidTx) {
sig->set_pubkey(keypair.publicKey().blob());
sig->set_signature(signedProto.blob());

ASSERT_THROW(shared_model::proto::TransactionBuilder()
shared_model::proto::TransactionBuilder()
.txCounter(tx_counter)
.creatorAccountId(account_id)
.assetQuantity(account_id, asset_id, amount)
.createdTime(created_time)
.build(),
std::invalid_argument);
.build();
}

0 comments on commit 3c58458

Please sign in to comment.