xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
owners.h
1
#pragma once
2
3
#include <test/jtx/Account.h>
4
#include <test/jtx/Env.h>
5
6
#include <xrpl/ledger/ReadView.h>
7
#include <xrpl/protocol/AccountID.h>
8
#include <xrpl/protocol/LedgerFormats.h>
9
10
#include <
cstdint
>
11
#include <
utility
>
12
13
namespace
xrpl
{
14
15
namespace
detail
{
16
17
std::uint32_t
18
ownedCountOf
(ReadView
const
& view,
AccountID
const
&
id
,
LedgerEntryType
type);
19
20
void
21
ownedCountHelper
(
22
test::jtx::Env& env,
23
AccountID
const
&
id
,
24
LedgerEntryType
type,
25
std::uint32_t value);
26
27
}
// namespace detail
28
29
namespace
test::jtx
{
30
31
// Helper for aliases
32
template
<LedgerEntryType Type>
33
class
OwnerCount
34
{
35
private
:
36
Account
account_
;
37
std::uint32_t
value_
;
38
39
public
:
40
OwnerCount
(
Account
account,
std::uint32_t
value) :
account_
(
std
::move(account)),
value_
(value)
41
{
42
}
43
44
void
45
operator()
(
Env
& env)
const
46
{
47
xrpl::detail::ownedCountHelper
(env,
account_
.id(), Type,
value_
);
48
}
49
};
50
54
class
Owners
55
{
56
private
:
57
Account
account_
;
58
std::uint32_t
value_
;
59
60
public
:
61
Owners
(
Account
account,
std::uint32_t
value) :
account_
(
std
::move(account)),
value_
(value)
62
{
63
}
64
65
void
66
operator()
(
Env
& env)
const
;
67
};
68
73
class
SponsoredOwners
74
{
75
private
:
76
Account
account_
;
77
std::uint32_t
value_
;
78
79
public
:
80
SponsoredOwners
(
Account
account,
std::uint32_t
value)
81
:
account_
(
std
::move(account)),
value_
(value)
82
{
83
}
84
85
void
86
operator()
(
Env
& env)
const
;
87
};
88
93
class
SponsoringOwners
94
{
95
private
:
96
Account
account_
;
97
std::uint32_t
value_
;
98
99
public
:
100
SponsoringOwners
(
Account
account,
std::uint32_t
value)
101
:
account_
(
std
::move(account)),
value_
(value)
102
{
103
}
104
105
void
106
operator()
(
Env
& env)
const
;
107
};
108
113
class
SponsoringAccountCount
114
{
115
private
:
116
Account
account_
;
117
std::uint32_t
value_
;
118
119
public
:
120
SponsoringAccountCount
(
Account
account,
std::uint32_t
value)
121
:
account_
(
std
::move(account)),
value_
(value)
122
{
123
}
124
125
void
126
operator()
(
Env
& env)
const
;
127
};
128
132
using
Lines
=
OwnerCount<ltRIPPLE_STATE>
;
133
137
using
Offers
=
OwnerCount<ltOFFER>
;
138
142
using
MPTokens
=
OwnerCount<ltMPTOKEN>
;
143
144
}
// namespace test::jtx
145
146
}
// namespace xrpl
xrpl::test::jtx::Account
Immutable cryptographic account descriptor.
Definition
jtx/Account.h:21
xrpl::test::jtx::Env
A transaction testing environment.
Definition
Env.h:161
xrpl::test::jtx::OwnerCount
Definition
owners.h:34
xrpl::test::jtx::OwnerCount< ltCHECK >::account_
Account account_
Definition
owners.h:36
xrpl::test::jtx::OwnerCount::operator()
void operator()(Env &env) const
Definition
owners.h:45
xrpl::test::jtx::OwnerCount< ltCHECK >::value_
std::uint32_t value_
Definition
owners.h:37
xrpl::test::jtx::OwnerCount::OwnerCount
OwnerCount(Account account, std::uint32_t value)
Definition
owners.h:40
xrpl::test::jtx::Owners::operator()
void operator()(Env &env) const
Definition
owners.cpp:42
xrpl::test::jtx::Owners::value_
std::uint32_t value_
Definition
owners.h:58
xrpl::test::jtx::Owners::account_
Account account_
Definition
owners.h:57
xrpl::test::jtx::Owners::Owners
Owners(Account account, std::uint32_t value)
Definition
owners.h:61
xrpl::test::jtx::SponsoredOwners::operator()
void operator()(Env &env) const
Definition
owners.cpp:48
xrpl::test::jtx::SponsoredOwners::value_
std::uint32_t value_
Definition
owners.h:77
xrpl::test::jtx::SponsoredOwners::account_
Account account_
Definition
owners.h:76
xrpl::test::jtx::SponsoredOwners::SponsoredOwners
SponsoredOwners(Account account, std::uint32_t value)
Definition
owners.h:80
xrpl::test::jtx::SponsoringAccountCount::account_
Account account_
Definition
owners.h:116
xrpl::test::jtx::SponsoringAccountCount::SponsoringAccountCount
SponsoringAccountCount(Account account, std::uint32_t value)
Definition
owners.h:120
xrpl::test::jtx::SponsoringAccountCount::value_
std::uint32_t value_
Definition
owners.h:117
xrpl::test::jtx::SponsoringAccountCount::operator()
void operator()(Env &env) const
Definition
owners.cpp:60
xrpl::test::jtx::SponsoringOwners::account_
Account account_
Definition
owners.h:96
xrpl::test::jtx::SponsoringOwners::SponsoringOwners
SponsoringOwners(Account account, std::uint32_t value)
Definition
owners.h:100
xrpl::test::jtx::SponsoringOwners::value_
std::uint32_t value_
Definition
owners.h:97
xrpl::test::jtx::SponsoringOwners::operator()
void operator()(Env &env) const
Definition
owners.cpp:54
cstdint
std::uint32_t
std
STL namespace.
xrpl::detail
Definition
base_uint.h:37
xrpl::detail::ownedCountOf
std::uint32_t ownedCountOf(ReadView const &view, AccountID const &id, LedgerEntryType type)
Definition
owners.cpp:17
xrpl::detail::ownedCountHelper
void ownedCountHelper(test::jtx::Env &env, AccountID const &id, LedgerEntryType type, std::uint32_t value)
Definition
owners.cpp:28
xrpl::test::jtx
Definition
Oracle_test.cpp:34
xrpl::test::jtx::Lines
OwnerCount< ltRIPPLE_STATE > Lines
Match the number of trust lines in the account's owner directory.
Definition
owners.h:132
xrpl::test::jtx::Offers
OwnerCount< ltOFFER > Offers
Match the number of offers in the account's owner directory.
Definition
owners.h:137
xrpl::test::jtx::MPTokens
OwnerCount< ltMPTOKEN > MPTokens
Match the number of MPToken in the account's owner directory.
Definition
owners.h:142
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::AccountID
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition
AccountID.h:34
xrpl::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition
LedgerFormats.h:40
utility
Generated by
1.17.0