hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
model_proto.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_MODEL_PROTO_HPP
7 #define IROHA_SHARED_MODEL_MODEL_PROTO_HPP
8 
11 #include "cryptography/blob.hpp"
12 
13 namespace shared_model {
14  namespace bindings {
19  template <typename UnsignedWrapper>
20  class ModelProto {
21  public:
22  ModelProto(UnsignedWrapper &us) : us_(us) {}
29  const crypto::Keypair &keypair) {
30  UnsignedWrapper wrapper = us_.signAndAddSignature(keypair);
31  return ModelProto<UnsignedWrapper>(wrapper);
32  }
33 
39  return us_.finish().blob();
40  }
41 
42  private:
43  UnsignedWrapper us_;
44  };
45  } // namespace bindings
46 } // namespace shared_model
47 
48 #endif // IROHA_SHARED_MODEL_MODEL_PROTO_HPP
Definition: blob.hpp:24
Definition: keypair.hpp:19
Definition: model_proto.hpp:20
ModelProto< UnsignedWrapper > signAndAddSignature(const crypto::Keypair &keypair)
Definition: model_proto.hpp:28
crypto::Blob finish()
Definition: model_proto.hpp:38
Definition: command_executor.hpp:12
ModelProto(UnsignedWrapper &us)
Definition: model_proto.hpp:22