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) = 0;
37 
42  const types::AccountIdType &account_id,
43  const types::DomainIdType &domain_id,
44  types::QuorumType quorum,
45  const types::JsonType &jsonData) = 0;
46 
51  const types::AccountIdType &account_id,
52  const types::AssetIdType &asset_id,
53  const Amount &balance) = 0;
54 
59  const types::AssetIdType &asset_id,
60  const types::DomainIdType &domain_id,
61  types::PrecisionType precision) = 0;
62 
67  const types::DomainIdType &domain_id,
68  const types::RoleIdType &default_role) = 0;
69 
75  const interface::Signature::SignedType &signed_data) = 0;
76 
77  virtual ~CommonObjectsFactory() = default;
78  };
79  } // namespace interface
80 } // namespace shared_model
81 
82 #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:41
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:49
Definition: amount.hpp:20
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
virtual FactoryResult< std::unique_ptr< Peer > > createPeer(const types::AddressType &address, const types::PubkeyType &public_key)=0
Definition: common_objects_factory.hpp:26
std::string AccountIdType
Type of account id.
Definition: types.hpp:35
Definition: signed.hpp:17
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:37
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:57
std::string JsonType
Type of JSON data.
Definition: types.hpp:71
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:47
std::string AssetIdType
Type of asset id.
Definition: types.hpp:51