rippled
Loading...
Searching...
No Matches
pay.cpp
1#include <test/jtx/pay.h>
2
3#include <xrpl/protocol/TxFlags.h>
4#include <xrpl/protocol/jss.h>
5
6namespace ripple {
7namespace test {
8namespace jtx {
9
11pay(AccountID const& account, AccountID const& to, AnyAmount amount)
12{
13 amount.to(to);
14 Json::Value jv;
15 jv[jss::Account] = to_string(account);
16 jv[jss::Amount] = amount.value.getJson(JsonOptions::none);
17 jv[jss::Destination] = to_string(to);
18 jv[jss::TransactionType] = jss::Payment;
19 jv[jss::Flags] = tfFullyCanonicalSig;
20 return jv;
21}
23pay(Account const& account, Account const& to, AnyAmount amount)
24{
25 return pay(account.id(), to.id(), amount);
26}
27
28} // namespace jtx
29} // namespace test
30} // namespace ripple
Represents a JSON value.
Definition json_value.h:130
Json::Value getJson(JsonOptions=JsonOptions::none) const override
Definition STAmount.cpp:753
Immutable cryptographic account descriptor.
Definition Account.h:20
AccountID id() const
Returns the Account ID.
Definition Account.h:92
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition pay.cpp:11
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
constexpr std::uint32_t tfFullyCanonicalSig
Transaction flags.
Definition TxFlags.h:41
Amount specifier with an option for any issuer.
void to(AccountID const &id)