3#include <test/jtx/Account.h>
4#include <test/jtx/Env.h>
6#include <xrpl/beast/utility/Zero.h>
7#include <xrpl/core/ServiceRegistry.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/ledger/helpers/DirectoryHelpers.h>
10#include <xrpl/protocol/Asset.h>
11#include <xrpl/protocol/Issue.h>
12#include <xrpl/protocol/LedgerFormats.h>
13#include <xrpl/protocol/MPTIssue.h>
14#include <xrpl/protocol/SField.h>
15#include <xrpl/protocol/STPathSet.h>
28 Asset const& takerPays,
29 Asset const& takerGets)
33 if (sle->getType() == ltOFFER && sle->getFieldAmount(sfTakerPays).asset() == takerPays &&
34 sle->getFieldAmount(sfTakerGets).asset() == takerGets)
49 if (sle->getType() == ltOFFER && sle->getFieldAmount(sfTakerPays) == takerPays &&
50 sle->getFieldAmount(sfTakerGets) == takerGets)
66 return countOffers(env, account, takerPays, takerGets) > 0;
75 return countOffers(env, account, takerPays, takerGets) > 0;
91 template <
class First,
class... Rest>
92 explicit TestPath(First&& first, Rest&&... rest)
108 template <
class First,
class... Rest>
110 addHelper(First&& first, Rest&&... rest);
116 path.emplaceBack(pe);
149template <
class First,
class... Rest>
154 if constexpr (
sizeof...(rest) > 0)
177 template <
class First,
class... Rest>
178 explicit PathSet(First&& first, Rest&&... rest)
191 template <
class First,
class... Rest>
195 paths.emplaceBack(std::move(first.path));
196 if constexpr (
sizeof...(rest) > 0)
A currency issued by an account.
constexpr MPTID const & getMptID() const
AccountID const & getIssuer() const
std::shared_ptr< STLedgerEntry const > const & const_ref
void addHelper(First first, Rest... rest)
PathSet(First &&first, Rest &&... rest)
PathSet(PathSet const &)=default
PathSet & operator=(PathSet &&)=default
PathSet(PathSet &&)=default
PathSet & operator=(PathSet const &)=default
TestPath(TestPath const &)=default
TestPath(TestPath &&)=default
void addHelper(First &&first, Rest &&... rest)
TestPath(First &&first, Rest &&... rest)
TestPath & operator=(TestPath &&)=default
TestPath & operator=(TestPath const &)=default
TestPath & pushBack(Issue const &iss)
Immutable cryptographic account descriptor.
A transaction testing environment.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
std::size_t countOffers(jtx::Env &env, jtx::Account const &account, Asset const &takerPays, Asset const &takerGets)
Count offer.
bool isOffer(jtx::Env &env, jtx::Account const &account, STAmount const &takerPays, STAmount const &takerGets)
An offer exists.
BaseUInt< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(SLE::const_ref)> const &f)
Iterate all items in the given directory.