LCOV - code coverage report
Current view: top level - shared_model/backend/protobuf/common_objects - account_asset.hpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 5 5 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_PROTO_ACCOUNT_ASSET_HPP
       7             : #define IROHA_PROTO_ACCOUNT_ASSET_HPP
       8             : 
       9             : #include "backend/protobuf/common_objects/trivial_proto.hpp"
      10             : #include "backend/protobuf/util.hpp"
      11             : #include "interfaces/common_objects/account_asset.hpp"
      12             : #include "qry_responses.pb.h"
      13             : 
      14             : namespace shared_model {
      15             :   namespace proto {
      16             :     class AccountAsset final
      17             :         : public CopyableProto<interface::AccountAsset,
      18             :                                iroha::protocol::AccountAsset,
      19             :                                AccountAsset> {
      20             :      public:
      21             :       template <typename AccountAssetType>
      22             :       explicit AccountAsset(AccountAssetType &&accountAssetType)
      23         110 :           : CopyableProto(std::forward<AccountAssetType>(accountAssetType)) {}
      24             : 
      25             :       AccountAsset(const AccountAsset &o) : AccountAsset(o.proto_) {}
      26             : 
      27             :       AccountAsset(AccountAsset &&o) noexcept
      28             :           : AccountAsset(std::move(o.proto_)) {}
      29             : 
      30             :       const interface::types::AccountIdType &accountId() const override {
      31          63 :         return proto_->account_id();
      32             :       }
      33             : 
      34             :       const interface::types::AssetIdType &assetId() const override {
      35          67 :         return proto_->asset_id();
      36             :       }
      37             : 
      38             :       const interface::Amount &balance() const override {
      39          54 :         return balance_;
      40             :       }
      41             : 
      42             :      private:
      43         110 :       const interface::Amount balance_{proto_->balance()};
      44             :     };
      45             :   }  // namespace proto
      46             : }  // namespace shared_model
      47             : 
      48             : #endif  // IROHA_PROTO_ACCOUNT_ASSET_HPP

Generated by: LCOV version 1.13