LCOV - code coverage report
Current view: top level - shared_model/cryptography/model_impl - keypair.cpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 8 13 61.5 %
Date: 2019-03-07 14:46:43 Functions: 5 7 71.4 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Soramitsu Co., Ltd. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0
       4             :  */
       5             : 
       6             : #include "cryptography/keypair.hpp"
       7             : 
       8             : #include "utils/string_builder.hpp"
       9             : 
      10             : namespace shared_model {
      11             :   namespace crypto {
      12             : 
      13             :     const Keypair::PublicKeyType &Keypair::publicKey() const {
      14       14399 :       return public_key_;
      15             :     }
      16             : 
      17             :     const Keypair::PrivateKeyType &Keypair::privateKey() const {
      18       10052 :       return private_key_;
      19             :     }
      20             : 
      21             :     bool Keypair::operator==(const Keypair &keypair) const {
      22           0 :       return publicKey() == keypair.publicKey()
      23           0 :           and privateKey() == keypair.privateKey();
      24             :     }
      25             : 
      26             :     std::string Keypair::toString() const {
      27           6 :       return detail::PrettyStringBuilder()
      28           6 :           .init("Keypair")
      29           6 :           .append("publicKey", publicKey().toString())
      30           6 :           .append("privateKey", privateKey().toString())
      31           6 :           .finalize();
      32           0 :     }
      33             : 
      34             :     Keypair *Keypair::clone() const {
      35           0 :       return new Keypair(publicKey(), privateKey());
      36           0 :     }
      37             : 
      38             :     Keypair::Keypair(const Keypair::PublicKeyType &public_key,
      39             :                      const Keypair::PrivateKeyType &private_key)
      40        4296 :         : public_key_(public_key), private_key_(private_key) {}
      41             : 
      42             :   }  // namespace crypto
      43             : }  // namespace shared_model

Generated by: LCOV version 1.13