Line data Source code
1 : /**
2 : * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3 : * SPDX-License-Identifier: Apache-2.0
4 : */
5 :
6 : #include "backend/protobuf/commands/proto_create_account.hpp"
7 : #include "cryptography/hash.hpp"
8 :
9 : namespace shared_model {
10 : namespace proto {
11 :
12 : template <typename CommandType>
13 : CreateAccount::CreateAccount(CommandType &&command)
14 11619 : : CopyableProto(std::forward<CommandType>(command)),
15 11639 : create_account_{proto_->create_account()},
16 11694 : pubkey_{crypto::Hash::fromHexString(create_account_.public_key())} {}
17 :
18 : template CreateAccount::CreateAccount(CreateAccount::TransportType &);
19 : template CreateAccount::CreateAccount(const CreateAccount::TransportType &);
20 : template CreateAccount::CreateAccount(CreateAccount::TransportType &&);
21 :
22 : CreateAccount::CreateAccount(const CreateAccount &o)
23 0 : : CreateAccount(o.proto_) {}
24 :
25 : CreateAccount::CreateAccount(CreateAccount &&o) noexcept
26 11697 : : CreateAccount(std::move(o.proto_)) {}
27 :
28 : const interface::types::PubkeyType &CreateAccount::pubkey() const {
29 5522 : return pubkey_;
30 : }
31 :
32 : const interface::types::AccountNameType &CreateAccount::accountName()
33 : const {
34 5563 : return create_account_.account_name();
35 : }
36 :
37 : const interface::types::DomainIdType &CreateAccount::domainId() const {
38 5519 : return create_account_.domain_id();
39 : }
40 :
41 : } // namespace proto
42 : } // namespace shared_model
|