20 #include <ripple/beast/core/LexicalCast.h>
21 #include <ripple/beast/unit_test.h>
22 #include <ripple/protocol/Feature.h>
23 #include <ripple/protocol/SField.h>
24 #include <ripple/protocol/jss.h>
26 #include <test/jtx/Env.h>
27 #include <test/jtx/PathSet.h>
41 testcase(
"Discrepancy test : XRP Discrepancy");
42 using namespace test::jtx;
43 Env env{*
this, features};
53 env.fund(XRP(2000), A1);
54 env.fund(XRP(1000), A2, A6, A7);
55 env.fund(XRP(5000), A3);
56 env.fund(XRP(1000000), A4);
57 env.fund(XRP(600000), A5);
60 env(trust(A1, A3[
"CNY"](200000)));
61 env(pay(A3, A1, A3[
"CNY"](31)));
64 env(trust(A1, A2[
"JPY"](1000000)));
65 env(pay(A2, A1, A2[
"JPY"](729117)));
68 env(trust(A4, A2[
"JPY"](10000000)));
69 env(pay(A2, A4, A2[
"JPY"](470056)));
72 env(trust(A5, A3[
"CNY"](50000)));
73 env(pay(A3, A5, A3[
"CNY"](8683)));
76 env(trust(A6, A3[
"CNY"](3000)));
77 env(pay(A3, A6, A3[
"CNY"](293)));
80 env(trust(A7, A6[
"CNY"](50000)));
81 env(pay(A6, A7, A6[
"CNY"](261)));
84 env(offer(A4, XRP(49147), A2[
"JPY"](34501)));
85 env(offer(A5, A3[
"CNY"](3150), XRP(80086)));
86 env(offer(A7, XRP(1233), A6[
"CNY"](25)));
94 env(pay(A1, A1, A2[
"JPY"](1000)),
95 json(payPaths.json()),
97 sendmax(A3[
"CNY"](56)));
101 jrq2[jss::binary] =
false;
102 jrq2[jss::transaction] =
105 auto jrr = env.rpc(
"json",
"tx",
to_string(jrq2))[jss::result];
106 uint64_t fee{jrr[jss::Fee].
asUInt()};
107 auto meta = jrr[jss::meta];
109 uint64_t sumFinal{0};
131 sumPrev += beast::lexicalCastThrow<std::uint64_t>(
134 sumFinal += beast::lexicalCastThrow<std::uint64_t>(
140 BEAST_EXPECT(sumPrev - sumFinal == fee);
147 using namespace test::jtx;
148 auto const sa = supported_amendments();
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
const std::string fieldName
void testXRPDiscrepancy(FeatureBitset features)
const SField sfFinalFields
const SField sfDeletedNode
constexpr std::uint32_t tfPartialPayment
const SField sfAffectedNodes
const SField sfModifiedNode
bool isMember(const char *key) const
Return true if the object has a member named key.
const SField sfPreviousFields
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const SF_UINT16 sfLedgerEntryType
const SField sfCreatedNode
const SF_AMOUNT sfBalance
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
const uint256 featureFlowCross
std::string asString() const
Returns the unquoted string value.