hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
common_objects_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_COMMON_OBJECTS_FACTORY_HPP
7 #define IROHA_COMMON_OBJECTS_FACTORY_HPP
8 
9 #include <memory>
10 
11 #include "common/result.hpp"
19 
20 namespace shared_model {
21  namespace interface {
27  public:
28  template <typename T>
29  using FactoryResult = iroha::expected::Result<T, std::string>;
30 
35  const types::AddressType &address,
36  const types::PubkeyType &public_key,
37  const boost::optional<types::TLSCertificateType> &tls_certificate =
38  boost::none) = 0;
39 
44  const types::AccountIdType &account_id,
45  const types::DomainIdType &domain_id,
46  types::QuorumType quorum,
47  const types::JsonType &jsonData) = 0;
48 
53  const types::AccountIdType &account_id,
54  const types::AssetIdType &asset_id,
55  const Amount &balance) = 0;
56 
61  const types::AssetIdType &asset_id,
62  const types::DomainIdType &domain_id,
63  types::PrecisionType precision) = 0;
64 
69  const types::DomainIdType &domain_id,
70  const types::RoleIdType &default_role) = 0;
71 
77  const interface::Signature::SignedType &signed_data) = 0;
78 
79  virtual ~CommonObjectsFactory() = default;
80  };
81  } // namespace interface
82 } // namespace shared_model
83 
84 #endif // IROHA_COMMONOBJECTSFACTORY_HPP
virtual FactoryResult< std::unique_ptr< Account > > createAccount(const types::AccountIdType &account_id, const types::DomainIdType &domain_id, types::QuorumType quorum, const types::JsonType &jsonData)=0
std::string AddressType
Type of peer address.
Definition: types.hpp:45
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:53
Definition: amount.hpp:19
virtual FactoryResult< std::unique_ptr< AccountAsset > > createAccountAsset(const types::AccountIdType &account_id, const types::AssetIdType &asset_id, const Amount &balance)=0
iroha::expected::Result< T, std::string > FactoryResult
Definition: common_objects_factory.hpp:29
Definition: common_objects_factory.hpp:26
std::string AccountIdType
Type of account id.
Definition: types.hpp:39
Definition: signed.hpp:17
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:41
virtual FactoryResult< std::unique_ptr< Peer > > createPeer(const types::AddressType &address, const types::PubkeyType &public_key, const boost::optional< types::TLSCertificateType > &tls_certificate=boost::none)=0
virtual FactoryResult< std::unique_ptr< Asset > > createAsset(const types::AssetIdType &asset_id, const types::DomainIdType &domain_id, types::PrecisionType precision)=0
Definition: public_key.hpp:16
virtual FactoryResult< std::unique_ptr< Signature > > createSignature(const interface::types::PubkeyType &key, const interface::Signature::SignedType &signed_data)=0
Definition: command_executor.hpp:12
virtual FactoryResult< std::unique_ptr< Domain > > createDomain(const types::DomainIdType &domain_id, const types::RoleIdType &default_role)=0
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:62
std::string JsonType
Type of JSON data.
Definition: types.hpp:74
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:51
std::string AssetIdType
Type of asset id.
Definition: types.hpp:55