6 #ifndef IROHA_UNSIGNED_PROTO_HPP 7 #define IROHA_UNSIGNED_PROTO_HPP 38 : object_(
std::move(w.object_)),
39 object_finalized_(w.object_finalized_) {
40 w.object_finalized_ =
true;
44 object_ = std::move(w.object_);
45 object_finalized_ = w.object_finalized_;
46 w.object_finalized_ =
true;
62 if (object_finalized_) {
63 throw std::runtime_error(
"object has already been finalized");
65 object_.addSignature(signedBlob, keypair.
publicKey());
75 if (boost::size(object_.signatures()) == 0) {
76 throw std::invalid_argument(
"Cannot get object without signatures");
78 if (object_finalized_) {
79 throw std::runtime_error(
"object has already been finalized");
82 object_finalized_ =
true;
83 return std::move(object_);
87 return object_.hash();
90 template <
typename U = T>
92 std::is_base_of<shared_model::interface::Transaction, U>::value,
95 return object_.reducedHash();
100 bool object_finalized_{
false};
105 #endif // IROHA_UNSIGNED_PROTO_HPP UnsignedWrapper(T &&o)
Definition: unsigned_proto.hpp:35
T ModelType
Definition: unsigned_proto.hpp:27
Definition: keypair.hpp:19
static Signed sign(const Blob &blob, const Keypair &keypair)
Definition: crypto_signer.hpp:30
UnsignedWrapper< T > & operator=(UnsignedWrapper< T > &&w)
Definition: unsigned_proto.hpp:43
UnsignedWrapper(const T &o)
Definition: unsigned_proto.hpp:33
Definition: unsigned_proto.hpp:25
UnsignedWrapper(UnsignedWrapper< T > &&w)
Definition: unsigned_proto.hpp:37
interface::types::HashType hash()
Definition: unsigned_proto.hpp:86
Definition: command_executor.hpp:12
std::enable_if_t< std::is_base_of< shared_model::interface::Transaction, U >::value, interface::types::HashType > reducedHash() const
Definition: unsigned_proto.hpp:94
T finish()
Definition: unsigned_proto.hpp:74
#define DEPRECATED
Definition: swig_keyword_hider.hpp:15
const PublicKeyType & publicKey() const
Definition: keypair.cpp:13
UnsignedWrapper & signAndAddSignature(const crypto::Keypair &keypair)
Definition: unsigned_proto.hpp:59