22#include <xrpl/protocol/Feature.h>
23#include <xrpl/protocol/jss.h>
41 jv[jss::Account] = account.human();
44 jv[jss::TransactionType] = jss::TrustSet;
54 auto const USD = gw[
"USD"];
58 env.
fund(
XRP(100000),
"alice",
"bob", gw);
61 env(
auth(gw,
"alice",
"USD"));
64 env(
trust(
"alice", USD(1000)));
65 env(
trust(
"bob", USD(1000)));
66 env(
pay(gw,
"alice", USD(100)));
67 env(
pay(gw,
"bob", USD(100)),
69 env(
pay(
"alice",
"bob", USD(50)),
78 testAuth(sa - featurePermissionedDEX);
83BEAST_DEFINE_TESTSUITE(SetAuth, app,
ripple);
A currency issued by an account.
Immutable cryptographic account descriptor.
AccountID id() const
Returns the Account ID.
A transaction testing environment.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Set the expected result code for a JTx The test will fail if the code doesn't match.
Keylet line(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
Json::Value trust(Account const &account, STAmount const &amount, std::uint32_t flags)
Modify a trust line.
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
FeatureBitset testable_amendments()
XRP_t const XRP
Converts to XRP Issue or STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::uint32_t tfSetfAuth
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
constexpr std::uint32_t asfRequireAuth
bool to_currency(Currency &, std::string const &)
Tries to convert a string to a Currency, returns true on success.
void run() override
Runs the suite.
void testAuth(FeatureBitset features)
static Json::Value auth(jtx::Account const &account, jtx::Account const &dest, std::string const ¤cy)