xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
paths.h
1
#pragma once
2
3
#include <test/jtx/Account.h>
4
#include <test/jtx/Env.h>
5
#include <test/jtx/JTx.h>
6
#include <test/jtx/amount.h>
7
8
#include <xrpl/json/json_value.h>
9
#include <xrpl/protocol/AccountID.h>
10
#include <xrpl/protocol/Asset.h>
11
12
#include <
type_traits
>
13
14
namespace
xrpl
{
15
class
STPath
;
16
17
namespace
test::jtx
{
18
22
class
Paths
23
{
24
private
:
25
Asset
in_
;
26
int
depth_
;
27
unsigned
int
limit_
;
28
29
public
:
30
Paths
(
Asset
const
& in,
int
depth = 7,
unsigned
int
limit = 4)
31
:
in_
(in),
depth_
(depth),
limit_
(limit)
32
{
33
}
34
35
void
36
operator()
(
Env
&,
JTx
& jt)
const
;
37
};
38
39
//------------------------------------------------------------------------------
40
46
class
Path
47
{
48
private
:
49
json::Value
jv_
;
50
51
public
:
52
Path
();
53
54
template
<
class
T,
class
... Args>
55
explicit
Path
(T
const
& t, Args
const
&... args);
56
57
Path
(
STPath
const
& p);
58
59
void
60
operator()
(
Env
&,
JTx
& jt)
const
;
61
62
private
:
63
json::Value
&
64
create
();
65
66
void
67
appendOne
(
Account
const
& account);
68
69
void
70
appendOne
(
AccountID
const
& account);
71
72
template
<
class
T>
73
void
74
appendOne
(T
const
& t)
75
requires
(
std::is_constructible_v<Account, T>
)
76
{
77
appendOne
(
Account
{t});
78
}
79
80
void
81
appendOne
(
IOU
const
& iou);
82
83
void
84
appendOne
(
BookSpec
const
& book);
85
86
template
<
class
T,
class
... Args>
87
void
88
append
(T
const
& t, Args
const
&... args);
89
};
90
91
template
<
class
T,
class
... Args>
92
Path::Path
(T
const
& t, Args
const
&... args) :
jv_
(
json
::ValueType::Array)
93
{
94
append
(t, args...);
95
}
96
97
template
<
class
T,
class
... Args>
98
void
99
Path::append
(T
const
& t, Args
const
&... args)
100
{
101
appendOne
(t);
102
if
constexpr
(
sizeof
...(args) > 0)
103
append
(args...);
104
}
105
106
}
// namespace test::jtx
107
108
}
// namespace xrpl
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::Asset
Definition
Asset.h:52
xrpl::STPath
Definition
STPathSet.h:134
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::IOU
Converts to IOU Issue or STAmount.
Definition
src/test/jtx/amount.h:404
xrpl::test::jtx::Path::append
void append(T const &t, Args const &... args)
Definition
paths.h:99
xrpl::test::jtx::Path::jv_
json::Value jv_
Definition
paths.h:49
xrpl::test::jtx::Path::appendOne
void appendOne(T const &t)
Definition
paths.h:74
xrpl::test::jtx::Path::operator()
void operator()(Env &, JTx &jt) const
Definition
paths.cpp:114
xrpl::test::jtx::Path::Path
Path()
xrpl::test::jtx::Path::create
json::Value & create()
Definition
paths.cpp:75
xrpl::test::jtx::Path::appendOne
void appendOne(Account const &account)
Definition
paths.cpp:81
xrpl::test::jtx::Paths::in_
Asset in_
Definition
paths.h:25
xrpl::test::jtx::Paths::Paths
Paths(Asset const &in, int depth=7, unsigned int limit=4)
Definition
paths.h:30
xrpl::test::jtx::Paths::depth_
int depth_
Definition
paths.h:26
xrpl::test::jtx::Paths::limit_
unsigned int limit_
Definition
paths.h:27
xrpl::test::jtx::Paths::operator()
void operator()(Env &, JTx &jt) const
Definition
paths.cpp:26
std::is_constructible_v
T is_constructible_v
json
JSON (JavaScript Object Notation).
Definition
json_errors.h:5
xrpl::test::jtx
Definition
Oracle_test.cpp:34
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::test::jtx::BookSpec
Definition
src/test/jtx/amount.h:245
xrpl::test::jtx::JTx
Execution context for applying a JSON transaction.
Definition
JTx.h:27
type_traits
Generated by
1.17.0