20#ifndef RIPPLE_LEDGER_TESTS_PATHSET_H_INCLUDED
21#define RIPPLE_LEDGER_TESTS_PATHSET_H_INCLUDED
24#include <xrpl/basics/Log.h>
25#include <xrpl/protocol/TxFlags.h>
36 Issue const& takerPays,
37 Issue const& takerGets)
42 if (sle->getType() == ltOFFER &&
43 sle->getFieldAmount(sfTakerPays).issue() == takerPays &&
44 sle->getFieldAmount(sfTakerGets).issue() == takerGets)
60 if (sle->getType() == ltOFFER &&
61 sle->getFieldAmount(sfTakerPays) == takerPays &&
62 sle->getFieldAmount(sfTakerGets) == takerGets)
77 return countOffers(env, account, takerPays, takerGets) > 0;
86 Issue const& takerPays,
87 Issue const& takerGets)
89 return countOffers(env, account, takerPays, takerGets) > 0;
105 template <
class First,
class... Rest>
106 explicit Path(First&& first, Rest&&... rest)
108 addHelper(std::forward<First>(first), std::forward<Rest>(rest)...);
120 template <
class First,
class... Rest>
122 addHelper(First&& first, Rest&&... rest);
128 path.emplace_back(pe);
146 path.emplace_back(account.id(), beast::zero, beast::zero);
150template <
class First,
class... Rest>
155 if constexpr (
sizeof...(rest) > 0)
178 template <
class First,
class... Rest>
179 explicit PathSet(First&& first, Rest&&... rest)
181 addHelper(std::forward<First>(first), std::forward<Rest>(rest)...);
192 template <
class First,
class... Rest>
196 paths.emplace_back(std::move(first.path));
197 if constexpr (
sizeof...(rest) > 0)
A currency issued by an account.
PathSet & operator=(PathSet const &)=default
PathSet(First &&first, Rest &&... rest)
PathSet(PathSet &&)=default
PathSet(PathSet const &)=default
void addHelper(First first, Rest... rest)
PathSet & operator=(PathSet &&)=default
Path & operator=(Path &&)=default
Path(First &&first, Rest &&... rest)
void addHelper(First &&first, Rest &&... rest)
Path & push_back(Issue const &iss)
Path(Path const &)=default
Path & operator=(Path const &)=default
Immutable cryptographic account descriptor.
A transaction testing environment.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
Set Paths, SendMax on a JTx.
bool isOffer(jtx::Env &env, jtx::Account const &account, STAmount const &takerPays, STAmount const &takerGets)
An offer exists.
std::size_t countOffers(jtx::Env &env, jtx::Account const &account, Issue const &takerPays, Issue const &takerGets)
Count offer.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.