xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
helpers
/libxrpl/helpers/Account.h
1
#pragma once
2
3
#include <xrpl/protocol/AccountID.h>
4
#include <xrpl/protocol/KeyType.h>
5
#include <xrpl/protocol/PublicKey.h>
6
#include <xrpl/protocol/SecretKey.h>
7
8
#include <
string
>
9
#include <
string_view
>
10
#include <
utility
>
11
12
namespace
xrpl::test
{
13
20
class
Account
21
{
22
public
:
29
static
Account
const
kMaster
;
30
39
explicit
Account
(
std::string_view
name
,
KeyType
type =
KeyType::Secp256k1
);
40
44
[[nodiscard]]
std::string
const
&
45
name
() const noexcept
46
{
47
return
name_
;
48
}
49
53
[[nodiscard]]
AccountID
const
&
54
id
() const noexcept
55
{
56
return
id_
;
57
}
58
62
[[nodiscard]]
PublicKey
const
&
63
pk
() const noexcept
64
{
65
return
keyPair_
.first;
66
}
67
71
[[nodiscard]]
SecretKey
const
&
72
sk
() const noexcept
73
{
74
return
keyPair_
.second;
75
}
76
80
operator
AccountID
const
&()
const
noexcept
81
{
82
return
id_
;
83
}
84
85
private
:
86
std::string
name_
;
87
std::pair<PublicKey, SecretKey>
keyPair_
;
88
AccountID
id_
;
89
};
90
91
}
// namespace xrpl::test
std::string
std::string_view
xrpl::PublicKey
A public key.
Definition
PublicKey.h:53
xrpl::SecretKey
A secret key.
Definition
SecretKey.h:24
xrpl::test::Account::Account
Account(std::string_view name, KeyType type=KeyType::Secp256k1)
Create an account from a name.
Definition
/libxrpl/helpers/Account.cpp:12
xrpl::test::Account::sk
SecretKey const & sk() const noexcept
Return the secret key.
Definition
/libxrpl/helpers/Account.h:72
xrpl::test::Account::name_
std::string name_
Definition
/libxrpl/helpers/Account.h:86
xrpl::test::Account::keyPair_
std::pair< PublicKey, SecretKey > keyPair_
Definition
/libxrpl/helpers/Account.h:87
xrpl::test::Account::id
AccountID const & id() const noexcept
Return the AccountID.
Definition
/libxrpl/helpers/Account.h:54
xrpl::test::Account::kMaster
static Account const kMaster
The master account that holds all XRP in genesis.
Definition
/libxrpl/helpers/Account.h:29
xrpl::test::Account::pk
PublicKey const & pk() const noexcept
Return the public key.
Definition
/libxrpl/helpers/Account.h:63
xrpl::test::Account::name
std::string const & name() const noexcept
Return the human-readable name.
Definition
/libxrpl/helpers/Account.h:45
xrpl::test::Account::id_
AccountID id_
Definition
/libxrpl/helpers/Account.h:88
xrpl::test::jtx::Account::Account
Account()=delete
xrpl::test
Definition
STLedgerEntry.h:21
xrpl::KeyType
KeyType
Definition
KeyType.h:8
xrpl::KeyType::Secp256k1
@ Secp256k1
Definition
KeyType.h:9
xrpl::AccountID
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition
AccountID.h:34
std::pair
string
string_view
utility
Generated by
1.17.0