xrpld
Loading...
Searching...
No Matches
owners.h
1#pragma once
2
3#include <test/jtx/Env.h>
4
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/protocol/LedgerFormats.h>
7#include <xrpl/protocol/UintTypes.h>
8
9#include <cstdint>
10#include <utility>
11
12namespace xrpl {
13
14namespace detail {
15
16std::uint32_t
17ownedCountOf(ReadView const& view, AccountID const& id, LedgerEntryType type);
18
19void
21 test::jtx::Env& env,
22 AccountID const& id,
23 LedgerEntryType type,
24 std::uint32_t value);
25
26} // namespace detail
27
28namespace test::jtx {
29
30// Helper for aliases
31template <LedgerEntryType Type>
33{
34private:
37
38public:
39 OwnerCount(Account account, std::uint32_t value) : account_(std::move(account)), value_(value)
40 {
41 }
42
43 void
44 operator()(Env& env) const
45 {
47 }
48};
49
51class Owners
52{
53private:
56
57public:
58 Owners(Account account, std::uint32_t value) : account_(std::move(account)), value_(value)
59 {
60 }
61
62 void
63 operator()(Env& env) const;
64};
65
68
71
74
75} // namespace test::jtx
76
77} // namespace xrpl
Immutable cryptographic account descriptor.
Definition jtx/Account.h:17
A transaction testing environment.
Definition Env.h:143
void operator()(Env &env) const
Definition owners.h:44
OwnerCount(Account account, std::uint32_t value)
Definition owners.h:39
void operator()(Env &env) const
Definition owners.cpp:42
std::uint32_t value_
Definition owners.h:55
Owners(Account account, std::uint32_t value)
Definition owners.h:58
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:67
OwnerCount< ltMPTOKEN > mptokens
Match the number of MPToken in the account's owner directory.
Definition owners.h:73
OwnerCount< ltOFFER > offers
Match the number of offers in the account's owner directory.
Definition owners.h:70
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:28
LedgerEntryType
Identifiers for on-ledger objects.