138 cfg->fees.referenceFee = 10;
142 env.fund(
XRP(10000), a1);
148 auto const hasTxs = [apiVersion](
json::Value const& j) {
152 return j.isMember(jss::result) && (j[jss::result][jss::status] ==
"success") &&
153 (j[jss::result][jss::transactions].size() == 2) &&
154 (j[jss::result][jss::transactions][0u][jss::tx][jss::TransactionType] ==
156 (j[jss::result][jss::transactions][1u][jss::tx][jss::TransactionType] ==
158 (j[jss::result][jss::transactions][1u][jss::tx][jss::DeliverMax] ==
160 (j[jss::result][jss::transactions][1u][jss::tx][jss::Amount] ==
161 j[jss::result][jss::transactions][1u][jss::tx][jss::DeliverMax]);
164 if (j.isMember(jss::result) && (j[jss::result][jss::status] ==
"success") &&
165 (j[jss::result][jss::transactions].size() == 2) &&
166 (j[jss::result][jss::transactions][0u][jss::tx_json]
167 [jss::TransactionType] == jss::AccountSet))
169 auto const& payment = j[jss::result][jss::transactions][1u];
170 return payment.isMember(jss::tx_json) &&
171 (payment[jss::tx_json][jss::TransactionType] == jss::Payment) &&
172 (payment[jss::tx_json][jss::DeliverMax] ==
"10000000010") &&
173 (!payment[jss::tx_json].isMember(jss::Amount)) &&
174 (!payment[jss::tx_json].isMember(jss::hash)) &&
175 (payment[jss::hash] ==
176 "9F3085D85F472D1CC29627F260DF68EDE59D42D1D0C33E345"
177 "ECF0D4CE981D0A8") &&
178 (payment[jss::validated] ==
true) &&
179 (payment[jss::ledger_index] == 3) &&
180 (payment[jss::ledger_hash] ==
181 "F1B386FB6C239EE5EF63109372E38C4E85328316371496794617D1FAC4B68F31") &&
182 (payment[jss::close_time_iso] ==
"2000-01-01T00:00:10Z");
192 return j.isMember(jss::result) && (j[jss::result][jss::status] ==
"success") &&
193 (j[jss::result][jss::transactions].size() == 0);
199 j[jss::result][jss::error_code] == code &&
200 j[jss::result][jss::error_message] == message;
204 jParams[jss::api_version] = apiVersion;
207 env.rpc(
"json",
"account_tx",
to_string(jParams)),
209 "Missing field 'account'."));
211 jParams[jss::account] =
"0xDEADBEEF";
214 env.rpc(
"json",
"account_tx",
to_string(jParams)),
216 "Account malformed."));
218 jParams[jss::account] = a1.human();
219 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(jParams))));
224 p[jss::ledger_index_min] = -1;
225 p[jss::ledger_index_max] = -1;
226 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
228 p[jss::ledger_index_min] = 0;
229 p[jss::ledger_index_max] = 100;
232 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
237 env.rpc(
"json",
"account_tx",
to_string(p)),
239 "Ledger index malformed."));
242 p[jss::ledger_index_min] = 1;
243 p[jss::ledger_index_max] = 2;
246 BEAST_EXPECT(noTxs(env.rpc(
"json",
"account_tx",
to_string(p))));
251 env.rpc(
"json",
"account_tx",
to_string(p)),
253 "Ledger index malformed."));
256 p[jss::ledger_index_min] = 2;
257 p[jss::ledger_index_max] = 1;
259 env.rpc(
"json",
"account_tx",
to_string(p)),
261 (apiVersion == 1 ?
"Ledger indexes invalid." :
"Ledger range is invalid.")));
266 p[jss::ledger_index_min] = -1;
267 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
269 p[jss::ledger_index_min] = 1;
272 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
277 env.rpc(
"json",
"account_tx",
to_string(p)),
279 "Ledger index malformed."));
282 p[jss::ledger_index_min] = env.current()->header().seq;
284 env.rpc(
"json",
"account_tx",
to_string(p)),
286 (apiVersion == 1 ?
"Ledger indexes invalid." :
"Ledger range is invalid.")));
292 p[jss::ledger_index_max] = -1;
293 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
295 p[jss::ledger_index_max] = env.current()->header().seq;
298 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
303 env.rpc(
"json",
"account_tx",
to_string(p)),
305 "Ledger index malformed."));
308 p[jss::ledger_index_max] = 3;
309 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
311 p[jss::ledger_index_max] = env.closed()->header().seq;
312 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
314 p[jss::ledger_index_max] = env.closed()->header().seq - 1;
315 BEAST_EXPECT(noTxs(env.rpc(
"json",
"account_tx",
to_string(p))));
322 p[jss::ledger_index] = env.closed()->header().seq;
323 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
325 p[jss::ledger_index] = env.closed()->header().seq - 1;
326 BEAST_EXPECT(noTxs(env.rpc(
"json",
"account_tx",
to_string(p))));
328 p[jss::ledger_index] = env.current()->header().seq;
330 env.rpc(
"json",
"account_tx",
to_string(p)),
332 "Ledger not validated."));
334 p[jss::ledger_index] = env.current()->header().seq + 1;
342 p[jss::ledger_index] =
"validated";
343 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
345 p[jss::ledger_index] =
"closed";
346 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
348 p[jss::ledger_index] =
"current";
350 env.rpc(
"json",
"account_tx",
to_string(p)),
352 "Ledger not validated."));
354 p[jss::ledger_index] =
"";
356 env.rpc(
"json",
"account_tx",
to_string(p)),
358 "Ledger not validated."));
365 p[jss::ledger_hash] =
to_string(env.closed()->header().hash);
366 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
368 p[jss::ledger_hash] =
to_string(env.closed()->header().parentHash);
369 BEAST_EXPECT(noTxs(env.rpc(
"json",
"account_tx",
to_string(p))));
375 jParams[jss::account] =
"0xDEADBEEF";
376 jParams[jss::account] = a1.human();
379 p[jss::ledger_index_max] = -1;
380 p[jss::ledger_index_min] = -1;
381 p[jss::ledger_index] = -1;
385 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
390 env.rpc(
"json",
"account_tx",
to_string(p)),
399 p[jss::ledger_index_max] = env.current()->header().seq;
402 BEAST_EXPECT(hasTxs(env.rpc(apiVersion,
"json",
"account_tx",
to_string(p))));
407 env.rpc(
"json",
"account_tx",
to_string(p)),
409 "Ledger index malformed."));
414 auto const testInvalidAccountParam = [&](
auto const& param) {
416 params[jss::account] = param;
417 auto jrr = env.rpc(
"json",
"account_tx",
to_string(params))[jss::result];
418 BEAST_EXPECT(jrr[jss::error] ==
"invalidParams");
420 BEAST_EXPECT(jrr[jss::error_message] ==
"Invalid field 'account'.");
423 testInvalidAccountParam(1);
424 testInvalidAccountParam(1.1);
425 testInvalidAccountParam(
true);
433 p[jss::binary] =
"asdf";
437 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
442 env.rpc(
"json",
"account_tx",
to_string(p)),
444 "Invalid field 'binary'."));
447 p[jss::binary] =
true;
449 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
451 p[jss::forward] =
"true";
454 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
459 env.rpc(
"json",
"account_tx",
to_string(p)),
461 "Invalid field 'forward'."));
464 p[jss::forward] =
false;
465 result = env.rpc(
"json",
"account_tx",
to_string(p));
466 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
475 env.rpc(
"json",
"account_tx",
to_string(p)),
477 "Invalid field 'limit'."));
482 env.rpc(
"json",
"account_tx",
to_string(p)),
487 p[jss::limit] =
"10";
489 env.rpc(
"json",
"account_tx",
to_string(p)),
494 p[jss::limit] =
true;
496 env.rpc(
"json",
"account_tx",
to_string(p)),
501 p[jss::limit] =
false;
503 env.rpc(
"json",
"account_tx",
to_string(p)),
510 env.rpc(
"json",
"account_tx",
to_string(p)),
517 env.rpc(
"json",
"account_tx",
to_string(p)),
524 env.rpc(
"json",
"account_tx",
to_string(p)),
529 p[jss::limit] =
"malformed";
531 env.rpc(
"json",
"account_tx",
to_string(p)),
537 p[jss::limit].
append(
"limit");
539 env.rpc(
"json",
"account_tx",
to_string(p)),
546 p[jss::limit][jss::limit] = 10;
548 env.rpc(
"json",
"account_tx",
to_string(p)),
555 env.rpc(
"json",
"account_tx",
to_string(p))[jss::result][jss::status] ==
"success");
567 using namespace std::chrono_literals;
573 auto const usd{gw[
"USD"]};
575 env.
fund(
XRP(1000000), alice, gw);
582 env(
pay(alice, gw,
XRP(100)));
589 env(
trust(alice, usd(200)),
Sig(alie));
598 env(
signers(alice, 1, {{
"bogie", 1}, {
"demon", 1}}),
Sig(alie));
606 escrow[jss::TransactionType] = jss::EscrowCreate;
607 escrow[jss::Account] = account.human();
608 escrow[jss::Destination] = to.human();
616 escrowWithFinish[sfFinishAfter.jsonName] = nextTime.
time_since_epoch().count();
619 env(escrowWithFinish,
Sig(alie));
622 escrowWithCancel[sfFinishAfter.jsonName] = nextTime.
time_since_epoch().count();
623 escrowWithCancel[sfCancelAfter.jsonName] = nextTime.
time_since_epoch().count() + 1;
626 env(escrowWithCancel,
Sig(alie));
631 escrowFinish[jss::TransactionType] = jss::EscrowFinish;
632 escrowFinish[jss::Account] = alice.
human();
633 escrowFinish[sfOwner.jsonName] = alice.
human();
634 escrowFinish[sfOfferSequence.jsonName] = escrowFinishSeq;
635 env(escrowFinish,
Sig(alie));
639 escrowCancel[jss::TransactionType] = jss::EscrowCancel;
640 escrowCancel[jss::Account] = alice.
human();
641 escrowCancel[sfOwner.jsonName] = alice.
human();
642 escrowCancel[sfOfferSequence.jsonName] = escrowCancelSeq;
643 env(escrowCancel,
Sig(alie));
652 payChanCreate[jss::TransactionType] = jss::PaymentChannelCreate;
653 payChanCreate[jss::Account] = alice.
human();
654 payChanCreate[jss::Destination] = gw.
human();
657 payChanCreate[sfPublicKey.jsonName] =
strHex(alice.
pk().
slice());
658 env(payChanCreate,
Sig(alie));
667 payChanFund[jss::TransactionType] = jss::PaymentChannelFund;
668 payChanFund[jss::Account] = alice.
human();
669 payChanFund[sfChannel.jsonName] = payChanIndex;
671 env(payChanFund,
Sig(alie));
676 payChanClaim[jss::TransactionType] = jss::PaymentChannelClaim;
677 payChanClaim[jss::Flags] = tfClose;
678 payChanClaim[jss::Account] = gw.
human();
679 payChanClaim[sfChannel.jsonName] = payChanIndex;
680 payChanClaim[sfPublicKey.jsonName] =
strHex(alice.
pk().
slice());
688 auto const aliceCheckId =
712 params[jss::account] = alice.
human();
713 params[jss::ledger_index_min] = -1;
714 params[jss::ledger_index_max] = -1;
718 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
719 BEAST_EXPECT(result[jss::result][jss::transactions].isArray());
721 json::Value const& txs{result[jss::result][jss::transactions]};
728 {0, jss::DepositPreauth, {jss::DepositPreauth}, {jss::Ticket}, {jss::AccountRoot, jss::DirectoryNode}},
729 {1, jss::TicketCreate, {jss::Ticket}, {}, {jss::AccountRoot, jss::DirectoryNode}},
730 {2, jss::CheckCancel, {}, {jss::Check}, {jss::AccountRoot, jss::AccountRoot, jss::DirectoryNode, jss::DirectoryNode}},
731 {3, jss::CheckCash, {}, {jss::Check}, {jss::AccountRoot, jss::AccountRoot, jss::DirectoryNode, jss::DirectoryNode}},
732 {4, jss::CheckCreate, {jss::Check}, {}, {jss::AccountRoot, jss::AccountRoot, jss::DirectoryNode, jss::DirectoryNode}},
733 {5, jss::CheckCreate, {jss::Check}, {}, {jss::AccountRoot, jss::AccountRoot, jss::DirectoryNode, jss::DirectoryNode}},
734 {6, jss::PaymentChannelClaim, {}, {jss::PayChannel}, {jss::AccountRoot, jss::AccountRoot, jss::DirectoryNode, jss::DirectoryNode}},
735 {7, jss::PaymentChannelFund, {}, {}, {jss::AccountRoot, jss::PayChannel}},
736 {8, jss::PaymentChannelCreate, {jss::PayChannel}, {}, {jss::AccountRoot, jss::AccountRoot, jss::DirectoryNode, jss::DirectoryNode}},
737 {9, jss::EscrowCancel, {}, {jss::Escrow}, {jss::AccountRoot, jss::DirectoryNode}},
738 {10, jss::EscrowFinish, {}, {jss::Escrow}, {jss::AccountRoot, jss::DirectoryNode}},
739 {11, jss::EscrowCreate, {jss::Escrow}, {}, {jss::AccountRoot, jss::DirectoryNode}},
740 {12, jss::EscrowCreate, {jss::Escrow}, {}, {jss::AccountRoot, jss::DirectoryNode}},
741 {13, jss::SignerListSet, {jss::SignerList}, {}, {jss::AccountRoot, jss::DirectoryNode}},
742 {14, jss::OfferCancel, {}, {jss::Offer, jss::DirectoryNode}, {jss::AccountRoot, jss::DirectoryNode}},
743 {15, jss::OfferCreate, {jss::Offer, jss::DirectoryNode}, {}, {jss::AccountRoot, jss::DirectoryNode}},
744 {16, jss::TrustSet, {jss::RippleState, jss::DirectoryNode, jss::DirectoryNode}, {}, {jss::AccountRoot, jss::AccountRoot}},
745 {17, jss::SetRegularKey, {}, {}, {jss::AccountRoot}},
746 {18, jss::Payment, {}, {}, {jss::AccountRoot, jss::AccountRoot}},
747 {19, jss::AccountSet, {}, {}, {jss::AccountRoot}},
748 {20, jss::AccountSet, {}, {}, {jss::AccountRoot}},
749 {21, jss::Payment, {jss::AccountRoot}, {}, {jss::AccountRoot}},
753 BEAST_EXPECT(
std::size(kSanity) == result[jss::result][jss::transactions].size());
755 for (
unsigned int index{0}; index <
std::size(kSanity); ++index)
770 using namespace std::chrono_literals;
776 env.
fund(
XRP(10000), alice, becky);
781 BEAST_EXPECT(env.
closed()->exists(beckyAcctKey));
792 auto const beckyPreDelBalance{env.
balance(becky)};
794 auto const acctDelFee{
drops(env.
current()->fees().increment)};
799 BEAST_EXPECT(!env.
closed()->exists(beckyAcctKey));
811 { 0, jss::Payment, {}, {}, {jss::AccountRoot, jss::AccountRoot}},
812 { 1, jss::Payment, {jss::AccountRoot}, {}, {jss::AccountRoot}},
813 { 2, jss::AccountDelete, {}, {jss::AccountRoot}, {jss::AccountRoot}},
814 { 3, jss::AccountSet, {}, {}, {jss::AccountRoot}},
815 { 4, jss::AccountSet, {}, {}, {jss::AccountRoot}},
816 { 5, jss::Payment, {jss::AccountRoot}, {}, {jss::AccountRoot}},
824 params[jss::account] = becky.
human();
825 params[jss::ledger_index_min] = -1;
826 params[jss::ledger_index_max] = -1;
830 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
831 BEAST_EXPECT(result[jss::result][jss::transactions].isArray());
834 static constexpr unsigned int kBeckyDeletedOffset = 2;
837 result[jss::result][jss::transactions].size() + kBeckyDeletedOffset);
839 json::Value const& txs{result[jss::result][jss::transactions]};
841 for (
unsigned int index = kBeckyDeletedOffset; index <
std::size(kSanity); ++index)
843 checkSanity(txs[index - kBeckyDeletedOffset], kSanity[index]);
854 env(
pay(alice, becky,
XRP(45)));
858 BEAST_EXPECT(env.
closed()->exists(beckyAcctKey));
862 env(
pay(becky, alice,
XRP(20)));
868 params[jss::account] = becky.
human();
869 params[jss::ledger_index_min] = -1;
870 params[jss::ledger_index_max] = -1;
874 BEAST_EXPECT(result[jss::result][jss::status] ==
"success");
875 BEAST_EXPECT(result[jss::result][jss::transactions].isArray());
877 BEAST_EXPECT(
std::size(kSanity) == result[jss::result][jss::transactions].size());
879 json::Value const& txs{result[jss::result][jss::transactions]};
881 for (
unsigned int index = 0; index <
std::size(kSanity); ++index)
893 using namespace std::chrono_literals;
896 cfg->fees.referenceFee = 10;
897 Env env(*
this, std::move(cfg));
903 MPTTester mptAlice(env, alice, {.holders = {bob, carol}});
908 params[jss::account] = alice.
human();
909 params[jss::limit] = 100;
910 auto const jv = env.
rpc(
"json",
"account_tx",
to_string(params))[jss::result];
912 BEAST_EXPECT(jv[jss::transactions].size() == size);
913 auto const& tx0(jv[jss::transactions][0u][jss::tx]);
914 BEAST_EXPECT(tx0[jss::TransactionType] == txType);
919 BEAST_EXPECT(tx0[jss::hash] == txHash);
926 .flags = tfMPTCanClawback | tfMPTRequireAuth | tfMPTCanTransfer,
929 checkAliceAcctTx(3, jss::MPTokenIssuanceCreate);
932 mptAlice.authorize({.account = bob});
933 checkAliceAcctTx(4, jss::MPTokenAuthorize);
946 mptAlice.authorize({.account = alice, .holder = bob});
947 checkAliceAcctTx(5, jss::MPTokenAuthorize);
950 mptAlice.authorize({.account = carol});
951 checkAliceAcctTx(6, jss::MPTokenAuthorize);
954 mptAlice.authorize({.account = alice, .holder = carol});
955 checkAliceAcctTx(7, jss::MPTokenAuthorize);
958 mptAlice.pay(alice, bob, 100);
959 checkAliceAcctTx(8, jss::Payment);
962 mptAlice.pay(bob, carol, 10);
963 checkAliceAcctTx(9, jss::Payment);
978 env.
fund(
XRP(10000), alice, bob, carol);
982 env(
pay(alice, carol,
XRP(10)));
994 env(
pay(bob, carol,
XRP(30)));
997 auto const countTxs = [&](
AccountID const& account,
1002 bool haveMarker =
false;
1008 params[jss::account] =
toBase58(account);
1009 params[jss::ledger_index_min] = -1;
1010 params[jss::ledger_index_max] = -1;
1012 if (!delegateParams.isNull())
1013 params[jss::delegate] = delegateParams;
1015 params[jss::limit] = *limit;
1017 params[jss::marker] = marker;
1019 auto const res = env.
rpc(
"json",
"account_tx",
to_string(params));
1020 auto const& result = res[jss::result];
1022 if (result.isMember(jss::transactions))
1023 count += result[jss::transactions].size();
1025 if (!limit || !result.isMember(jss::marker))
1028 marker = result[jss::marker];
1031 if (!BEAST_EXPECT(pages < 20))
1038 auto const checkError = [&](
json::Value const& delegateParams,
1043 params[jss::account] = alice.
human();
1044 params[jss::delegate] = delegateParams;
1045 auto res = env.
rpc(
"json",
"account_tx",
to_string(params));
1046 BEAST_EXPECT(res[jss::result][jss::error] == errToken);
1047 BEAST_EXPECT(res[jss::result][jss::error_code] == code);
1048 BEAST_EXPECT(res[jss::result][jss::error_message] == errMessage);
1054 p[jss::delegate_filter] =
"actor";
1055 BEAST_EXPECT(countTxs(alice.
id(), p) == 1);
1061 p[jss::delegate_filter] =
"actor";
1062 p[jss::counter_party] = bob.
human();
1063 BEAST_EXPECT(countTxs(alice.
id(), p) == 1);
1069 p[jss::delegate_filter] =
"actor";
1070 p[jss::counter_party] = carol.
human();
1071 BEAST_EXPECT(countTxs(alice.
id(), p) == 0);
1078 p[jss::delegate_filter] =
"authorizer";
1079 BEAST_EXPECT(countTxs(bob.
id(), p) == 1);
1085 p[jss::delegate_filter] =
"authorizer";
1086 p[jss::counter_party] = alice.
human();
1087 BEAST_EXPECT(countTxs(bob.
id(), p) == 1);
1095 p[jss::delegate_filter] =
"authorizer";
1096 BEAST_EXPECT(countTxs(alice.
id(), p) == 0);
1103 p[jss::delegate_filter] =
"authorizer";
1104 p[jss::counter_party] = carol.
human();
1105 BEAST_EXPECT(countTxs(bob.
id(), p) == 0);
1112 p[jss::delegate_filter] =
"actor";
1113 BEAST_EXPECT(countTxs(bob.
id(), p) == 0);
1119 checkError(p,
"invalidParams",
RpcInvalidParams,
"Invalid field 'delegate'.");
1125 checkError(p,
"invalidParams",
RpcInvalidParams,
"Invalid field 'delegate_filter'.");
1131 p[jss::delegate_filter] = 123;
1132 checkError(p,
"invalidParams",
RpcInvalidParams,
"Invalid field 'delegate_filter'.");
1138 p[jss::delegate_filter] =
"random_string";
1139 checkError(p,
"invalidParams",
RpcInvalidParams,
"Invalid field 'delegate_filter'.");
1145 p[jss::delegate_filter] =
"actor";
1146 p[jss::counter_party] = 123;
1147 checkError(p,
"invalidParams",
RpcInvalidParams,
"Invalid field 'counter_party'.");
1153 p[jss::delegate_filter] =
"actor";
1154 p[jss::counter_party] =
"not_an_account";
1163 Account const edward{
"edward"};
1164 env.
fund(
XRP(1000), daria, edward);
1166 env(
signers(alice, 2, {{daria, 1}, {edward, 1}}));
1168 env(
pay(alice, carol,
XRP(1)),
1170 Msig(daria, edward));
1176 p[jss::delegate_filter] =
"actor";
1177 BEAST_EXPECT(countTxs(alice.
id(), p) == 1);
1185 env(
pay(alice, bob,
XRP(1)));
1189 actorFilter[jss::delegate_filter] =
"actor";
1190 BEAST_EXPECT(countTxs(alice.
id(), actorFilter) == 1);
1192 BEAST_EXPECT(countTxs(alice.
id(), actorFilter, 1) == 1);
1194 actorFilter[jss::counter_party] = bob.
human();
1195 BEAST_EXPECT(countTxs(alice.
id(), actorFilter) == 1);
1196 BEAST_EXPECT(countTxs(alice.
id(), actorFilter, 1) == 1);
1199 authorizerFilter[jss::delegate_filter] =
"authorizer";
1200 BEAST_EXPECT(countTxs(bob.
id(), authorizerFilter) == 1);
1201 BEAST_EXPECT(countTxs(bob.
id(), authorizerFilter, 1) == 1);
1203 authorizerFilter[jss::counter_party] = alice.
human();
1204 BEAST_EXPECT(countTxs(bob.
id(), authorizerFilter) == 1);
1205 BEAST_EXPECT(countTxs(bob.
id(), authorizerFilter, 1) == 1);
1214 actorFilter[jss::delegate_filter] =
"actor";
1218 dp[jss::account] = alice.
human();
1219 dp[jss::ledger_index_min] = -1;
1220 dp[jss::ledger_index_max] = -1;
1221 dp[jss::delegate] = actorFilter;
1223 auto const dRes = env.
rpc(
"json",
"account_tx",
to_string(dp));
1224 BEAST_EXPECT(dRes[jss::result].isMember(jss::marker));
1225 json::Value const delegateMarker = dRes[jss::result][jss::marker];
1227 delegateMarker.
isMember(jss::delegate) && delegateMarker[jss::delegate].
asBool());
1232 p[jss::account] = alice.
human();
1233 p[jss::ledger_index_min] = -1;
1234 p[jss::ledger_index_max] = -1;
1236 p[jss::marker] = delegateMarker;
1237 auto const r = env.
rpc(
"json",
"account_tx",
to_string(p));
1238 BEAST_EXPECT(r[jss::result][jss::error] ==
"invalidParams");
1241 r[jss::result][jss::error_message] ==
1242 "Do not mix delegate and non-delegate pagination markers in account_tx; "
1243 "repeat the same `delegate` object when using a delegate marker.");
1248 np[jss::account] = alice.
human();
1249 np[jss::ledger_index_min] = -1;
1250 np[jss::ledger_index_max] = -1;
1252 auto const nRes = env.
rpc(
"json",
"account_tx",
to_string(np));
1253 BEAST_EXPECT(nRes[jss::result].isMember(jss::marker));
1254 json::Value const normalMarker = nRes[jss::result][jss::marker];
1255 BEAST_EXPECT(!normalMarker.
isMember(jss::delegate));
1260 p[jss::account] = alice.
human();
1261 p[jss::ledger_index_min] = -1;
1262 p[jss::ledger_index_max] = -1;
1264 p[jss::delegate] = actorFilter;
1265 p[jss::marker] = normalMarker;
1266 auto const r = env.
rpc(
"json",
"account_tx",
to_string(p));
1267 BEAST_EXPECT(r[jss::result][jss::error] ==
"invalidParams");
1270 r[jss::result][jss::error_message] ==
1271 "Do not mix delegate and non-delegate pagination markers in account_tx; "
1272 "repeat the same `delegate` object when using a delegate marker.");