LCOV - code coverage report
Current view: top level - shared_model/backend/protobuf/common_objects - asset.hpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 4 4 100.0 %
Date: 2019-03-07 14:46:43 Functions: 10 10 100.0 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Soramitsu Co., Ltd. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0
       4             :  */
       5             : 
       6             : #ifndef IROHA_SHARED_MODEL_PROTO_ASSET_HPP
       7             : #define IROHA_SHARED_MODEL_PROTO_ASSET_HPP
       8             : 
       9             : #include "backend/protobuf/common_objects/trivial_proto.hpp"
      10             : #include "backend/protobuf/util.hpp"
      11             : #include "interfaces/common_objects/asset.hpp"
      12             : #include "qry_responses.pb.h"
      13             : 
      14             : namespace shared_model {
      15             :   namespace proto {
      16             :     class Asset final : public CopyableProto<interface::Asset,
      17             :                                              iroha::protocol::Asset,
      18             :                                              Asset> {
      19             :      public:
      20             :       template <typename AssetType>
      21             :       explicit Asset(AssetType &&account)
      22           9 :           : CopyableProto(std::forward<AssetType>(account)) {}
      23             : 
      24             :       Asset(const Asset &o) : Asset(o.proto_) {}
      25             : 
      26             :       Asset(Asset &&o) noexcept : Asset(std::move(o.proto_)) {}
      27             : 
      28             :       const interface::types::AssetIdType &assetId() const override {
      29           7 :         return proto_->asset_id();
      30             :       }
      31             : 
      32             :       const interface::types::DomainIdType &domainId() const override {
      33           6 :         return proto_->domain_id();
      34             :       }
      35             : 
      36             :       interface::types::PrecisionType precision() const override {
      37           3 :         return proto_->precision();
      38             :       }
      39             :     };
      40             :   }  // namespace proto
      41             : }  // namespace shared_model
      42             : 
      43             : #endif  // IROHA_SHARED_MODEL_PROTO_ASSET_HPP

Generated by: LCOV version 1.13