xrpld
Loading...
Searching...
No Matches
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
13namespace xrpl {
14
15namespace detail {
16
17std::uint32_t
18ownedCountOf(ReadView const& view, AccountID const& id, LedgerEntryType type);
19
20void
22 test::jtx::Env& env,
23 AccountID const& id,
24 LedgerEntryType type,
25 std::uint32_t value);
26
27} // namespace detail
28
29namespace test::jtx {
30
31// Helper for aliases
32template <LedgerEntryType Type>
34{
35private:
38
39public:
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 {
48 }
49};
50
54class Owners
55{
56private:
59
60public:
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
74{
75private:
78
79public:
81 : account_(std::move(account)), value_(value)
82 {
83 }
84
85 void
86 operator()(Env& env) const;
87};
88
94{
95private:
98
99public:
101 : account_(std::move(account)), value_(value)
102 {
103 }
104
105 void
106 operator()(Env& env) const;
107};
108
114{
115private:
118
119public:
121 : account_(std::move(account)), value_(value)
122 {
123 }
124
125 void
126 operator()(Env& env) const;
127};
128
133
138
143
144} // namespace test::jtx
145
146} // namespace xrpl
Immutable cryptographic account descriptor.
Definition jtx/Account.h:21
A transaction testing environment.
Definition Env.h:161
void operator()(Env &env) const
Definition owners.h:45
OwnerCount(Account account, std::uint32_t value)
Definition owners.h:40
void operator()(Env &env) const
Definition owners.cpp:42
std::uint32_t value_
Definition owners.h:58
Owners(Account account, std::uint32_t value)
Definition owners.h:61
void operator()(Env &env) const
Definition owners.cpp:48
SponsoredOwners(Account account, std::uint32_t value)
Definition owners.h:80
SponsoringAccountCount(Account account, std::uint32_t value)
Definition owners.h:120
SponsoringOwners(Account account, std::uint32_t value)
Definition owners.h:100
void operator()(Env &env) const
Definition owners.cpp:54
STL namespace.
std::uint32_t ownedCountOf(ReadView const &view, AccountID const &id, LedgerEntryType type)
Definition owners.cpp:17
void ownedCountHelper(test::jtx::Env &env, AccountID const &id, LedgerEntryType type, std::uint32_t value)
Definition owners.cpp:28
OwnerCount< ltRIPPLE_STATE > lines
Match the number of trust lines in the account's owner directory.
Definition owners.h:132
OwnerCount< ltMPTOKEN > mptokens
Match the number of MPToken in the account's owner directory.
Definition owners.h:142
OwnerCount< ltOFFER > offers
Match the number of offers in the account's owner directory.
Definition owners.h:137
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
LedgerEntryType
Identifiers for on-ledger objects.