rippled
Loading...
Searching...
No Matches
rate.cpp
1#include <test/jtx/rate.h>
2
3#include <xrpl/basics/contract.h>
4#include <xrpl/protocol/jss.h>
5
6#include <stdexcept>
7
8namespace ripple {
9namespace test {
10namespace jtx {
11
13rate(Account const& account, double multiplier)
14{
15 if (multiplier > 4)
16 Throw<std::runtime_error>("rate multiplier out of range");
17 Json::Value jv;
18 jv[jss::Account] = account.human();
19 jv[jss::TransferRate] = std::uint32_t(1000000000 * multiplier);
20 jv[jss::TransactionType] = jss::AccountSet;
21 return jv;
22}
23
24} // namespace jtx
25} // namespace test
26} // namespace ripple
Represents a JSON value.
Definition json_value.h:130
Immutable cryptographic account descriptor.
Definition Account.h:20
Json::Value rate(Account const &account, double multiplier)
Set a transfer rate.
Definition rate.cpp:13
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6