20#ifndef RIPPLE_LEDGER_TESTS_PATHSET_H_INCLUDED
21#define RIPPLE_LEDGER_TESTS_PATHSET_H_INCLUDED
25#include <xrpl/basics/Log.h>
26#include <xrpl/protocol/TxFlags.h>
37 Issue const& takerPays,
38 Issue const& takerGets)
43 if (sle->getType() == ltOFFER &&
44 sle->getFieldAmount(sfTakerPays).issue() == takerPays &&
45 sle->getFieldAmount(sfTakerGets).issue() == takerGets)
61 if (sle->getType() == ltOFFER &&
62 sle->getFieldAmount(sfTakerPays) == takerPays &&
63 sle->getFieldAmount(sfTakerGets) == takerGets)
78 return countOffers(env, account, takerPays, takerGets) > 0;
87 Issue const& takerPays,
88 Issue const& takerGets)
90 return countOffers(env, account, takerPays, takerGets) > 0;
106 template <
class First,
class... Rest>
107 explicit Path(First&& first, Rest&&... rest)
109 addHelper(std::forward<First>(first), std::forward<Rest>(rest)...);
121 template <
class First,
class... Rest>
123 addHelper(First&& first, Rest&&... rest);
129 path.emplace_back(pe);
147 path.emplace_back(account.id(), beast::zero, beast::zero);
151template <
class First,
class... Rest>
156 if constexpr (
sizeof...(rest) > 0)
179 template <
class First,
class... Rest>
180 explicit PathSet(First&& first, Rest&&... rest)
182 addHelper(std::forward<First>(first), std::forward<Rest>(rest)...);
193 template <
class First,
class... Rest>
197 paths.emplace_back(std::move(first.path));
198 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.