Skip to content

Commit

Permalink
Update naming in proto transaction validator
Browse files Browse the repository at this point in the history
Signed-off-by: kamilsa <[email protected]>
  • Loading branch information
kamilsa committed Dec 28, 2018
1 parent 6d99255 commit bf667bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions shared_model/validators/protobuf/proto_block_validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace shared_model {
== iroha::protocol::Block::BLOCK_VERSION_NOT_SET) {
reason.second.emplace_back("Block version is not set");
answer.addReason(std::move(reason));
return answer;
}

const auto &rejected_hashes =
Expand Down
12 changes: 6 additions & 6 deletions shared_model/validators/protobuf/proto_transaction_validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
namespace shared_model {
namespace validation {

void validateHexField(const std::string &public_key,
ReasonsGroupType &reason) {
void validatePublicKey(const std::string &public_key,
ReasonsGroupType &reason) {
if (not validateHexString(public_key)) {
reason.second.emplace_back("Public key is not in hex format");
}
Expand All @@ -31,22 +31,22 @@ namespace shared_model {
}
case iroha::protocol::Command::kAddSignatory: {
const auto &as = command.add_signatory();
validateHexField(as.public_key(), reason);
validatePublicKey(as.public_key(), reason);
break;
}
case iroha::protocol::Command::kCreateAccount: {
const auto &ca = command.create_account();
validateHexField(ca.public_key(), reason);
validatePublicKey(ca.public_key(), reason);
break;
}
case iroha::protocol::Command::kRemoveSignatory: {
const auto &rs = command.remove_signatory();
validateHexField(rs.public_key(), reason);
validatePublicKey(rs.public_key(), reason);
break;
}
case iroha::protocol::Command::kAddPeer: {
const auto &ap = command.add_peer();
validateHexField(ap.peer().peer_key(), reason);
validatePublicKey(ap.peer().peer_key(), reason);
break;
}
case iroha::protocol::Command::kCreateRole: {
Expand Down

0 comments on commit bf667bd

Please sign in to comment.