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"
20 
21 namespace shared_model {
22  namespace interface {
28  public:
29  template <typename T>
31 
36  const types::AddressType &address,
37  types::PublicKeyHexStringView public_key,
38  const std::optional<types::TLSCertificateType> &tls_certificate =
39  std::nullopt) = 0;
40 
45  const types::AccountIdType &account_id,
46  const types::DomainIdType &domain_id,
47  types::QuorumType quorum,
48  const types::JsonType &jsonData) = 0;
49 
54  const types::AccountIdType &account_id,
55  const types::AssetIdType &asset_id,
56  const Amount &balance) = 0;
57 
62  const types::AssetIdType &asset_id,
63  const types::DomainIdType &domain_id,
64  types::PrecisionType precision) = 0;
65 
70  const types::DomainIdType &domain_id,
71  const types::RoleIdType &default_role) = 0;
72 
77  types::PublicKeyHexStringView key,
78  types::SignedHexStringView signed_data) = 0;
79 
80  virtual ~CommonObjectsFactory() = default;
81  };
82  } // namespace interface
83 } // namespace shared_model
84 
85 #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:50
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:56
Definition: amount.hpp:19
Definition: result_fwd.hpp:27
virtual FactoryResult< std::unique_ptr< AccountAsset > > createAccountAsset(const types::AccountIdType &account_id, const types::AssetIdType &asset_id, const Amount &balance)=0
Definition: common_objects_factory.hpp:27
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
virtual FactoryResult< std::unique_ptr< Signature > > createSignature(types::PublicKeyHexStringView key, types::SignedHexStringView signed_data)=0
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:46
virtual FactoryResult< std::unique_ptr< Asset > > createAsset(const types::AssetIdType &asset_id, const types::DomainIdType &domain_id, types::PrecisionType precision)=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:65
std::string JsonType
Type of JSON data.
Definition: types.hpp:77
virtual FactoryResult< std::unique_ptr< Peer > > createPeer(const types::AddressType &address, types::PublicKeyHexStringView public_key, const std::optional< types::TLSCertificateType > &tls_certificate=std::nullopt)=0
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:54
std::string AssetIdType
Type of asset id.
Definition: types.hpp:58