1#include <test/jtx/TestHelpers.h> 
    2#include <test/jtx/offer.h> 
    3#include <test/jtx/owners.h> 
    5#include <xrpl/protocol/TxFlags.h> 
   17    return env.
rpc(
"json", 
"account_offers", 
to_string(jv))[jss::result];
 
 
   25    return env.
rpc(
"json", 
"account_lines", 
to_string(jv))[jss::result];
 
 
   76    return env.
current()->fees().base * n;
 
 
   82    auto feeDrops = env.
current()->fees().base;
 
 
   96        bool const accountLow = account < issue.
account;
 
   98        bool expectDefaultTrustLine = 
true;
 
  104            low.setIssuer(accountLow ? account : issue.
account);
 
  105            high.setIssuer(accountLow ? issue.
account : account);
 
  107            expectDefaultTrustLine = sle->getFieldAmount(sfLowLimit) == low &&
 
  108                sle->getFieldAmount(sfHighLimit) == high;
 
  111        auto amount = sle->getFieldAmount(sfBalance);
 
  115        return amount == value && expectDefaultTrustLine;
 
 
  144        [&](
auto const& issue) {
 
 
  163            if (sle->getType() == ltOFFER)
 
  167                        toMatch.begin(), toMatch.end(), [&](auto const& a) {
 
  168                            return a.in == sle->getFieldAmount(sfTakerPays) &&
 
  169                                a.out == sle->getFieldAmount(sfTakerGets);
 
  175    return size == cnt && matched == toMatch.size();
 
 
  182    jvParams[jss::ledger_index] = 
"current";
 
  183    jvParams[jss::account_root] = acct.
human();
 
  184    return env.
rpc(
"json", 
"ledger_entry", 
to_string(jvParams))[jss::result];
 
 
  195    jvParams[jss::ledger_index] = 
"current";
 
  196    jvParams[jss::ripple_state][jss::currency] = currency;
 
  198    jvParams[jss::ripple_state][jss::accounts].
append(acct_a.
human());
 
  199    jvParams[jss::ripple_state][jss::accounts].
append(acct_b.
human());
 
  200    return env.
rpc(
"json", 
"ledger_entry", 
to_string(jvParams))[jss::result];
 
 
  207    return jrr[jss::node][sfBalance.fieldName];
 
 
  234    jv[jss::TransactionType] = jss::PaymentChannelCreate;
 
  238    jv[jss::SettleDelay] = settleDelay.
count();
 
  241        jv[sfCancelAfter.fieldName] = cancelAfter->time_since_epoch().count();
 
  243        jv[sfDestinationTag.fieldName] = *dstTag;
 
 
  255    jv[jss::TransactionType] = jss::PaymentChannelFund;
 
  260        jv[sfExpiration.fieldName] = 
expiration->time_since_epoch().count();
 
 
  274    jv[jss::TransactionType] = jss::PaymentChannelClaim;
 
  282        jv[
"Signature"] = 
strHex(*signature);
 
  284        jv[
"PublicKey"] = 
strHex(pk->slice());
 
 
  301    auto const slep = view.
read({ltPAYCHAN, chan});
 
  304    return (*slep)[sfBalance];
 
 
  310    auto const slep = view.
read({ltPAYCHAN, chan});
 
 
 
  327    auto const ownerCount = env.
le(account)->getFieldU32(sfOwnerCount);
 
 
Value & append(Value const &value)
Append value to array at the end.
 
UInt size() const
Number of values in array or object.
 
constexpr value_type const & value() const
 
A currency issued by an account.
 
constexpr MPTID const & getMptID() const
 
Slice slice() const noexcept
 
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
 
Json::Value getJson(JsonOptions=JsonOptions::none) const override
 
Issue const & issue() const
 
void push_back(STPathElement const &e)
 
Immutable cryptographic account descriptor.
 
std::string const & human() const
Returns the human readable public key.
 
A transaction testing environment.
 
std::uint32_t ownerCount(Account const &account) const
Return the number of objects owned by an account.
 
void require(Args const &... args)
Check a set of requirements.
 
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.
 
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
 
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
 
Match the number of items in the account's owner directory.
 
@ arrayValue
array value (ordered list)
 
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
 
Keylet line(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
 
Keylet payChan(AccountID const &src, AccountID const &dst, std::uint32_t seq) noexcept
A PaymentChannel.
 
bool channelExists(ReadView const &view, uint256 const &chan)
 
Json::Value fund(AccountID const &account, uint256 const &channel, STAmount const &amount, std::optional< NetClock::time_point > const &expiration)
 
Json::Value create(AccountID const &account, AccountID const &to, STAmount const &amount, NetClock::duration const &settleDelay, PublicKey const &pk, std::optional< NetClock::time_point > const &cancelAfter, std::optional< std::uint32_t > const &dstTag)
 
uint256 channel(AccountID const &account, AccountID const &dst, std::uint32_t seqProxyValue)
 
Json::Value claim(AccountID const &account, uint256 const &channel, std::optional< STAmount > const &balance, std::optional< STAmount > const &amount, std::optional< Slice > const &signature, std::optional< PublicKey > const &pk)
 
STAmount channelBalance(ReadView const &view, uint256 const &chan)
 
bool checkArraySize(Json::Value const &val, unsigned int size)
 
std::uint32_t ownerCount(Env const &env, Account const &account)
 
Json::Value ledgerEntryRoot(Env &env, Account const &acct)
 
bool expectOffers(Env &env, AccountID const &account, std::uint16_t size, std::vector< Amounts > const &toMatch)
 
PrettyAmount xrpMinusFee(Env const &env, std::int64_t xrpAmount)
 
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
 
bool equal(STAmount const &sa1, STAmount const &sa2)
 
constexpr XRPAmount dropsPerXRP
 
Json::Value getAccountLines(Env &env, AccountID const &acctId)
 
Json::Value ledgerEntryState(Env &env, Account const &acct_a, Account const &acct_b, std::string const ¤cy)
 
void stpath_append_one(STPath &st, Account const &account)
 
void n_offers(Env &env, std::size_t n, Account const &account, STAmount const &in, STAmount const &out)
 
Json::Value accountBalance(Env &env, Account const &acct)
 
STPathElement IPE(Issue const &iss)
 
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
 
bool expectHolding(Env &env, AccountID const &account, STAmount const &value, bool defaultLimits)
 
STPathElement cpe(Currency const &c)
 
bool expectLedgerEntryRoot(Env &env, Account const &acct, STAmount const &expectedValue)
 
STPathElement allpe(AccountID const &a, Issue const &iss)
 
XRPAmount txfee(Env const &env, std::uint16_t n)
 
Json::Value getAccountOffers(Env &env, AccountID const &acct, bool current)
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
AccountID const & xrpAccount()
Compute AccountID from public key.
 
@ current
This was a new validation and was added.
 
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.
 
std::string strHex(FwdIt begin, FwdIt end)
 
std::string to_string(base_uint< Bits, Tag > const &a)
 
Represents an XRP or IOU quantity This customizes the string conversion and supports XRP conversions ...