Skip to content

Commit

Permalink
deserialize interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsa authored and lebdron committed Jul 18, 2017
1 parent 86f8824 commit 13ec92d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions irohad/ametsuchi/block_serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ using namespace rapidjson;
class BlockSerializer{
public:
std::vector<uint8_t > serialize(model::Block block);
model::Block deserialize(std::vector<uint8_t > bytes);
private:
void serialize(PrettyWriter<StringBuffer>& writer, model::Block block);
void serialize(PrettyWriter<StringBuffer>& writer, model::Signature signature);
Expand Down
9 changes: 9 additions & 0 deletions irohad/ametsuchi/impl/block_serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace iroha {

using namespace rapidjson;

/* Serialize */

std::vector<uint8_t> BlockSerializer::serialize(model::Block block) {
rapidjson::StringBuffer sb;
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(sb);
Expand Down Expand Up @@ -382,5 +384,12 @@ namespace iroha {

writer.EndObject();
}

/* Deserialize */

model::Block BlockSerializer::deserialize(std::vector<uint8_t> bytes) {

}

}
}
2 changes: 1 addition & 1 deletion irohad/ametsuchi/wsv_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace iroha {
* @param address
* @return
*/
virtual nonstd::optional<model::Peer> getPeers() = 0;
virtual nonstd::optional<model::Peer> getPeer(const std::string &address) = 0;
};

} // namespace ametsuchi
Expand Down

0 comments on commit 13ec92d

Please sign in to comment.