LCOV - code coverage report
Current view: top level - shared_model/interfaces/iroha_internal - proposal.hpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 0 10 0.0 %
Date: 2019-03-07 14:46:43 Functions: 3 8 37.5 %

          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_PROPOSAL_HPP
       7             : #define IROHA_SHARED_MODEL_PROPOSAL_HPP
       8             : 
       9             : #include "cryptography/default_hash_provider.hpp"
      10             : #include "interfaces/base/model_primitive.hpp"
      11             : #include "interfaces/common_objects/types.hpp"
      12             : #include "interfaces/transaction.hpp"
      13             : 
      14             : namespace shared_model {
      15             :   namespace interface {
      16             : 
      17             :     class Proposal : public ModelPrimitive<Proposal> {
      18             :      public:
      19             :       /**
      20             :        * @return transactions
      21             :        */
      22             :       virtual types::TransactionsCollectionType transactions() const = 0;
      23             : 
      24             :       /**
      25             :        * @return the height
      26             :        */
      27             :       virtual types::HeightType height() const = 0;
      28             : 
      29             :       /**
      30             :        * @return created time
      31             :        */
      32             :       virtual types::TimestampType createdTime() const = 0;
      33             : 
      34             :       bool operator==(const Proposal &rhs) const override {
      35           0 :         return transactions() == rhs.transactions() and height() == rhs.height()
      36           0 :             and createdTime() == rhs.createdTime();
      37           0 :       }
      38             : 
      39             :       virtual const types::BlobType &blob() const = 0;
      40             : 
      41             :       virtual const types::HashType &hash() const = 0;
      42             : 
      43             :       std::string toString() const override {
      44           0 :         return detail::PrettyStringBuilder()
      45           0 :             .init("Proposal")
      46           0 :             .append("height", std::to_string(height()))
      47           0 :             .append("transactions")
      48           0 :             .appendAll(transactions(),
      49             :                        [](auto &transaction) { return transaction.toString(); })
      50           0 :             .finalize();
      51           0 :       }
      52             :     };
      53             : 
      54             :   }  // namespace interface
      55             : }  // namespace shared_model
      56             : 
      57             : #endif  // IROHA_SHARED_MODEL_PROPOSAL_HPP

Generated by: LCOV version 1.13