rippled
Loading...
Searching...
No Matches
test
jtx
impl
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
8
namespace
ripple
{
9
namespace
test {
10
namespace
jtx {
11
12
Json::Value
13
rate
(
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
Json::Value
Represents a JSON value.
Definition
json_value.h:130
ripple::test::jtx::Account
Immutable cryptographic account descriptor.
Definition
Account.h:20
std::uint32_t
ripple::test::jtx::rate
Json::Value rate(Account const &account, double multiplier)
Set a transfer rate.
Definition
rate.cpp:13
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
stdexcept
Generated by
1.9.8