20#include <xrpld/ledger/BookDirs.h>
22#include <xrpl/protocol/Feature.h>
33 Env env(*
this, features);
36 env.
fund(
XRP(1000000),
"alice",
"bob",
"gw");
62 env(
offer(
"alice", gw[
"CNY"](50),
XRP(10)));
71 env(
pay(
"bob",
"alice",
Account(
"bob")[
"CNY"](10)));
75 Book(USD.issue(),
Account(
"bob")[
"CNY"].issue(), std::nullopt));
81 for (
auto i = 1, j = 3; i <= 3; ++i, --j)
82 for (
auto k = 0; k < 80; ++k)
88 auto i = 1, j = 3, k = 0;
89 for (
auto const& e : d)
91 BEAST_EXPECT(e->getFieldAmount(sfTakerPays) == AUD(i));
92 BEAST_EXPECT(e->getFieldAmount(sfTakerGets) ==
XRP(j));
Immutable cryptographic account descriptor.
A transaction testing environment.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
void trust(STAmount const &amount, Account const &account)
Establish trust lines.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
FeatureBitset testable_amendments()
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
XRP_t const XRP
Converts to XRP Issue or STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Book reversed(Book const &book)
void test_bookdir(FeatureBitset features)
void run() override
Runs the suite.