Skip to content

Commit

Permalink
Merge branch 'feature/connection-impl' into jp-new-architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
MizukiSonoko committed Jun 13, 2017
2 parents cb303c7 + dcc423c commit 996d496
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
19 changes: 10 additions & 9 deletions core/connection/api/command_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ limitations under the License.
*/

#include "command_service.hpp"
#include <validation/stateless/validator.hpp>
#include <ordering/quque.hpp>

namespace connection {
namespace api {
Expand All @@ -28,15 +30,14 @@ namespace connection {
// TODO: Use this to get client's ip and port.
(void) context;

Block_Body body;
*body.mutable_txs()->Add() = request;

Block block;
*block.mutable_body() = body;

// TODO: Return tracking log number (hash)
*response = ToriiResponse();

if(validator::stateless::validate(request)){
ordering::queue::append(request);
// TODO: Return tracking log number (hash)
*response = ToriiResponse();
}else{
// TODO: Return validation failed message
*response = ToriiResponse();
}
return grpc::Status::OK;
}

Expand Down
4 changes: 4 additions & 0 deletions core/ordering/observer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// Created by TaiseiIgarashi on 2017/06/14.
//

8 changes: 8 additions & 0 deletions core/ordering/observer.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Created by TaiseiIgarashi on 2017/06/14.
//

#ifndef IROHA_OBSERVER_HPP
#define IROHA_OBSERVER_HPP

#endif //IROHA_OBSERVER_HPP
2 changes: 1 addition & 1 deletion schema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#execute_process(COMMAND "protoc -I. --cpp_out=. --proto_path=commands.proto asset.proto")
#execute_process(COMMAND "protoc -I. --cpp_out=. --proto_path=commands.proto commands.proto")
#execute_process(COMMAND "protoc -I. --cpp_out=. --proto_path=commands.proto primitive.proto")

#execute_process(COMMAND "protoc --proto_path=. --grpc_out=. --cpp_out=. --plugin=protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin endpoint.proto")
ADD_LIBRARY(schema STATIC
asset.pb.cc
block.pb.cc
Expand Down

0 comments on commit 996d496

Please sign in to comment.