mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Get names of transactions and ledger types from jss
This commit is contained in:
committed by
Manoj doshi
parent
be139d9bde
commit
b39b0fef39
@@ -386,7 +386,7 @@ public:
|
||||
jvCheck[sfAccount.jsonName] = gw.human();
|
||||
jvCheck[sfSendMax.jsonName] = USD(10).value().getJson(0);
|
||||
jvCheck[sfDestination.jsonName] = alice.human();
|
||||
jvCheck[sfTransactionType.jsonName] = "CheckCreate";
|
||||
jvCheck[sfTransactionType.jsonName] = jss::CheckCreate;
|
||||
jvCheck[sfFlags.jsonName] = tfUniversal;
|
||||
env (jvCheck);
|
||||
env.close();
|
||||
@@ -416,7 +416,7 @@ public:
|
||||
{
|
||||
// gw creates an escrow that we can look for in the ledger.
|
||||
Json::Value jvEscrow;
|
||||
jvEscrow[jss::TransactionType] = "EscrowCreate";
|
||||
jvEscrow[jss::TransactionType] = jss::EscrowCreate;
|
||||
jvEscrow[jss::Flags] = tfUniversal;
|
||||
jvEscrow[jss::Account] = gw.human();
|
||||
jvEscrow[jss::Destination] = gw.human();
|
||||
@@ -452,7 +452,7 @@ public:
|
||||
{
|
||||
// Create a payment channel from qw to alice that we can look for.
|
||||
Json::Value jvPayChan;
|
||||
jvPayChan[jss::TransactionType] = "PaymentChannelCreate";
|
||||
jvPayChan[jss::TransactionType] = jss::PaymentChannelCreate;
|
||||
jvPayChan[jss::Flags] = tfUniversal;
|
||||
jvPayChan[jss::Account] = gw.human ();
|
||||
jvPayChan[jss::Destination] = alice.human ();
|
||||
@@ -497,7 +497,7 @@ public:
|
||||
|
||||
auto const& ticket = resp[jss::result][jss::account_objects][0u];
|
||||
BEAST_EXPECT (ticket[sfAccount.jsonName] == gw.human());
|
||||
BEAST_EXPECT (ticket[sfLedgerEntryType.jsonName] == "Ticket");
|
||||
BEAST_EXPECT (ticket[sfLedgerEntryType.jsonName] == jss::Ticket);
|
||||
BEAST_EXPECT (ticket[sfSequence.jsonName].asUInt() == 9);
|
||||
}
|
||||
// Run up the number of directory entries so gw has two
|
||||
|
||||
@@ -46,9 +46,9 @@ class AccountTX_test : public beast::unit_test::suite
|
||||
(j[jss::result][jss::status] == "success") &&
|
||||
(j[jss::result][jss::transactions].size() == 2) &&
|
||||
(j[jss::result][jss::transactions][0u][jss::tx]
|
||||
[jss::TransactionType] == "AccountSet") &&
|
||||
[jss::TransactionType] == jss::AccountSet) &&
|
||||
(j[jss::result][jss::transactions][1u][jss::tx]
|
||||
[jss::TransactionType] == "Payment");
|
||||
[jss::TransactionType] == jss::Payment);
|
||||
};
|
||||
|
||||
auto noTxs = [](Json::Value const& j) {
|
||||
|
||||
@@ -88,7 +88,7 @@ class AmendmentBlocked_test : public beast::unit_test::suite
|
||||
|
||||
Json::Value set_tx;
|
||||
set_tx[jss::Account] = bob.human();
|
||||
set_tx[jss::TransactionType] = "AccountSet";
|
||||
set_tx[jss::TransactionType] = jss::AccountSet;
|
||||
set_tx[jss::Fee] =
|
||||
static_cast<uint32_t>(8 * env.current()->fees().base);
|
||||
set_tx[jss::Sequence] = env.seq(bob);
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == XRP(75).value().getJson(0) &&
|
||||
t[jss::TakerPays] == USD(100).value().getJson(0);
|
||||
}));
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -378,7 +378,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == XRP(75).value().getJson(0) &&
|
||||
t[jss::TakerPays] == USD(100).value().getJson(0);
|
||||
}));
|
||||
@@ -454,7 +454,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == JPY(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == CNY(700).value().getJson(0);
|
||||
}));
|
||||
@@ -588,7 +588,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -613,7 +613,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == JPY(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == CNY(700).value().getJson(0);
|
||||
}));
|
||||
@@ -700,7 +700,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -717,7 +717,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == XRP(75).value().getJson(0) &&
|
||||
t[jss::TakerPays] == USD(100).value().getJson(0);
|
||||
}));
|
||||
@@ -734,7 +734,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == JPY(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == CNY(700).value().getJson(0);
|
||||
}));
|
||||
@@ -751,7 +751,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == CNY(75).value().getJson(0) &&
|
||||
t[jss::TakerPays] == JPY(100).value().getJson(0);
|
||||
}));
|
||||
@@ -864,7 +864,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == XRP(700).value().getJson(0);
|
||||
}));
|
||||
@@ -881,7 +881,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == XRP(75).value().getJson(0) &&
|
||||
t[jss::TakerPays] == USD(100).value().getJson(0);
|
||||
}));
|
||||
@@ -898,7 +898,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == JPY(100).value().getJson(0) &&
|
||||
t[jss::TakerPays] == CNY(700).value().getJson(0);
|
||||
}));
|
||||
@@ -915,7 +915,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == CNY(75).value().getJson(0) &&
|
||||
t[jss::TakerPays] == JPY(100).value().getJson(0);
|
||||
}));
|
||||
@@ -1005,7 +1005,7 @@ public:
|
||||
getBookDir(env, XRP, USD.issue()));
|
||||
BEAST_EXPECT(jrOffer[sfBookNode.fieldName] == "0000000000000000");
|
||||
BEAST_EXPECT(jrOffer[jss::Flags] == 0);
|
||||
BEAST_EXPECT(jrOffer[sfLedgerEntryType.fieldName] == "Offer");
|
||||
BEAST_EXPECT(jrOffer[sfLedgerEntryType.fieldName] == jss::Offer);
|
||||
BEAST_EXPECT(jrOffer[sfOwnerNode.fieldName] == "0000000000000000");
|
||||
BEAST_EXPECT(jrOffer[sfSequence.fieldName] == 3);
|
||||
BEAST_EXPECT(jrOffer[jss::TakerGets] == USD(10).value().getJson(0));
|
||||
@@ -1018,7 +1018,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(10).value().getJson(0) &&
|
||||
t[jss::owner_funds] == "100" &&
|
||||
t[jss::TakerPays] == XRP(4000).value().getJson(0);
|
||||
@@ -1031,7 +1031,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
auto const& t = jv[jss::transaction];
|
||||
return t[jss::TransactionType] == "OfferCreate" &&
|
||||
return t[jss::TransactionType] == jss::OfferCreate &&
|
||||
t[jss::TakerGets] == USD(5).value().getJson(0) &&
|
||||
t[jss::owner_funds] == "50" &&
|
||||
t[jss::TakerPays] == XRP(2000).value().getJson(0);
|
||||
@@ -1054,7 +1054,7 @@ public:
|
||||
getBookDir(env, XRP, USD.issue()));
|
||||
BEAST_EXPECT(jrNextOffer[sfBookNode.fieldName] == "0000000000000000");
|
||||
BEAST_EXPECT(jrNextOffer[jss::Flags] == 0);
|
||||
BEAST_EXPECT(jrNextOffer[sfLedgerEntryType.fieldName] == "Offer");
|
||||
BEAST_EXPECT(jrNextOffer[sfLedgerEntryType.fieldName] == jss::Offer);
|
||||
BEAST_EXPECT(jrNextOffer[sfOwnerNode.fieldName] == "0000000000000000");
|
||||
BEAST_EXPECT(jrNextOffer[sfSequence.fieldName] == 3);
|
||||
BEAST_EXPECT(jrNextOffer[jss::TakerGets] == USD(5).value().getJson(0));
|
||||
@@ -1089,7 +1089,7 @@ public:
|
||||
if(!(*maybeJv).isMember(jss::transaction))
|
||||
return false;
|
||||
auto const& t = (*maybeJv)[jss::transaction];
|
||||
if (t[jss::TransactionType] != "OfferCreate" ||
|
||||
if (t[jss::TransactionType] != jss::OfferCreate ||
|
||||
t[jss::TakerGets] != takerGets.value().getJson(0) ||
|
||||
t[jss::TakerPays] != takerPays.value().getJson(0))
|
||||
return false;
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
bool
|
||||
checkTxn(Json::Value const& t, Json::Value const& metaData)
|
||||
{
|
||||
if (t[jss::TransactionType].asString() != "Payment")
|
||||
if (t[jss::TransactionType].asString() != jss::Payment)
|
||||
return true;
|
||||
|
||||
bool isSet = metaData.isMember(jss::delivered_amount);
|
||||
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
|
||||
{
|
||||
Json::Value jv;
|
||||
jv[jss::TransactionType] = "EscrowCreate";
|
||||
jv[jss::TransactionType] = jss::EscrowCreate;
|
||||
jv[jss::Flags] = tfUniversal;
|
||||
jv[jss::Account] = Account{"bob5"}.human();
|
||||
jv[jss::Destination] = Account{"bob6"}.human();
|
||||
@@ -312,7 +312,7 @@ public:
|
||||
|
||||
{
|
||||
Json::Value jv;
|
||||
jv[jss::TransactionType] = "PaymentChannelCreate";
|
||||
jv[jss::TransactionType] = jss::PaymentChannelCreate;
|
||||
jv[jss::Flags] = tfUniversal;
|
||||
jv[jss::Account] = Account{"bob6"}.human ();
|
||||
jv[jss::Destination] = Account{"bob7"}.human ();
|
||||
@@ -325,6 +325,16 @@ public:
|
||||
env(jv);
|
||||
}
|
||||
|
||||
{
|
||||
Json::Value jv;
|
||||
jv[sfAccount.jsonName] = Account{"bob6"}.human ();
|
||||
jv[sfSendMax.jsonName] = "100000000";
|
||||
jv[sfDestination.jsonName] = Account{"bob7"}.human ();
|
||||
jv[sfTransactionType.jsonName] = jss::CheckCreate;
|
||||
jv[sfFlags.jsonName] = tfUniversal;
|
||||
env(jv);
|
||||
}
|
||||
|
||||
// bob9 DepositPreauths bob4 and bob8.
|
||||
env (deposit::auth (Account {"bob9"}, Account {"bob4"}));
|
||||
env (deposit::auth (Account {"bob9"}, Account {"bob8"}));
|
||||
@@ -344,84 +354,91 @@ public:
|
||||
auto const jrr = makeRequest(jss::account);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 12) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "AccountRoot" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::AccountRoot );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "amendments";
|
||||
auto const jrr = makeRequest(jss::amendments);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "Amendments" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::Amendments );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "check";
|
||||
auto const jrr = makeRequest(jss::check);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::Check );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "directory";
|
||||
auto const jrr = makeRequest(jss::directory);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 8) );
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 9) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "DirectoryNode" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::DirectoryNode );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "fee";
|
||||
auto const jrr = makeRequest(jss::fee);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "FeeSettings" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::FeeSettings );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "hashes";
|
||||
auto const jrr = makeRequest(jss::hashes);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 2) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "LedgerHashes" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::LedgerHashes );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "offer";
|
||||
auto const jrr = makeRequest(jss::offer);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "Offer" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::Offer );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "signer_list";
|
||||
auto const jrr = makeRequest(jss::signer_list);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "SignerList" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::SignerList );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "state";
|
||||
auto const jrr = makeRequest(jss::state);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "RippleState" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::RippleState );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "ticket";
|
||||
auto const jrr = makeRequest(jss::ticket);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "Ticket" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::Ticket );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "escrow";
|
||||
auto const jrr = makeRequest(jss::escrow);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "Escrow" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::Escrow );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "payment_channel";
|
||||
auto const jrr = makeRequest(jss::payment_channel);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 1) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "PayChannel" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::PayChannel );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "deposit_preauth";
|
||||
auto const jrr = makeRequest(jss::deposit_preauth);
|
||||
BEAST_EXPECT( checkArraySize(jrr[jss::state], 2) );
|
||||
for (auto const& j : jrr[jss::state])
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == "DepositPreauth" );
|
||||
BEAST_EXPECT( j["LedgerEntryType"] == jss::DepositPreauth );
|
||||
}
|
||||
|
||||
{ // jvParams[jss::type] = "misspelling";
|
||||
|
||||
@@ -342,7 +342,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
jv[sfAccount.jsonName] = account.human();
|
||||
jv[sfSendMax.jsonName] = sendMax.getJson(0);
|
||||
jv[sfDestination.jsonName] = dest.human();
|
||||
jv[sfTransactionType.jsonName] = "CheckCreate";
|
||||
jv[sfTransactionType.jsonName] = jss::CheckCreate;
|
||||
jv[sfFlags.jsonName] = tfUniversal;
|
||||
return jv;
|
||||
};
|
||||
@@ -358,7 +358,8 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
jvParams[jss::ledger_hash] = ledgerHash;
|
||||
Json::Value const jrr = env.rpc (
|
||||
"json", "ledger_entry", to_string (jvParams))[jss::result];
|
||||
BEAST_EXPECT(jrr[jss::node][sfLedgerEntryType.jsonName] == "Check");
|
||||
BEAST_EXPECT(
|
||||
jrr[jss::node][sfLedgerEntryType.jsonName] == jss::Check);
|
||||
BEAST_EXPECT(jrr[jss::node][sfSendMax.jsonName] == "100000000");
|
||||
}
|
||||
{
|
||||
@@ -407,7 +408,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
"json", "ledger_entry", to_string (jvParams))[jss::result];
|
||||
|
||||
BEAST_EXPECT(
|
||||
jrr[jss::node][sfLedgerEntryType.jsonName] == "DepositPreauth");
|
||||
jrr[jss::node][sfLedgerEntryType.jsonName] == jss::DepositPreauth);
|
||||
BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
|
||||
BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == becky.human());
|
||||
depositPreauthIndex = jrr[jss::node][jss::index].asString();
|
||||
@@ -420,8 +421,8 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
Json::Value const jrr = env.rpc (
|
||||
"json", "ledger_entry", to_string (jvParams))[jss::result];
|
||||
|
||||
BEAST_EXPECT(
|
||||
jrr[jss::node][sfLedgerEntryType.jsonName] == "DepositPreauth");
|
||||
BEAST_EXPECT(jrr[jss::node][sfLedgerEntryType.jsonName] ==
|
||||
jss::DepositPreauth);
|
||||
BEAST_EXPECT(jrr[jss::node][sfAccount.jsonName] == alice.human());
|
||||
BEAST_EXPECT(jrr[jss::node][sfAuthorize.jsonName] == becky.human());
|
||||
}
|
||||
@@ -660,7 +661,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
STAmount const& amount, NetClock::time_point const& cancelAfter)
|
||||
{
|
||||
Json::Value jv;
|
||||
jv[jss::TransactionType] = "EscrowCreate";
|
||||
jv[jss::TransactionType] = jss::EscrowCreate;
|
||||
jv[jss::Flags] = tfUniversal;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::Destination] = to.human();
|
||||
@@ -849,7 +850,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
PublicKey const& pk)
|
||||
{
|
||||
Json::Value jv;
|
||||
jv[jss::TransactionType] = "PaymentChannelCreate";
|
||||
jv[jss::TransactionType] = jss::PaymentChannelCreate;
|
||||
jv[jss::Account] = account.human();
|
||||
jv[jss::Destination] = to.human();
|
||||
jv[jss::Amount] = amount.getJson (0);
|
||||
@@ -1358,7 +1359,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(txj.isMember(jss::tx));
|
||||
auto const& tx = txj[jss::tx];
|
||||
BEAST_EXPECT(tx[jss::Account] == alice.human());
|
||||
BEAST_EXPECT(tx[jss::TransactionType] == "OfferCreate");
|
||||
BEAST_EXPECT(tx[jss::TransactionType] == jss::OfferCreate);
|
||||
txid1 = tx[jss::hash].asString();
|
||||
}
|
||||
|
||||
@@ -1442,7 +1443,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(txj.isMember(jss::tx));
|
||||
auto const& tx = txj[jss::tx];
|
||||
BEAST_EXPECT(tx[jss::Account] == alice.human());
|
||||
BEAST_EXPECT(tx[jss::TransactionType] == "AccountSet");
|
||||
BEAST_EXPECT(tx[jss::TransactionType] == jss::AccountSet);
|
||||
BEAST_EXPECT(tx[jss::hash] == txid2);
|
||||
}
|
||||
}
|
||||
@@ -1470,7 +1471,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(jrr[jss::ledger][jss::accountState].size() == 1u);
|
||||
BEAST_EXPECT(
|
||||
jrr[jss::ledger][jss::accountState][0u]["LedgerEntryType"]
|
||||
== "LedgerHashes");
|
||||
== jss::LedgerHashes);
|
||||
index = jrr[jss::ledger][jss::accountState][0u]["index"].asString();
|
||||
}
|
||||
{
|
||||
|
||||
@@ -208,7 +208,7 @@ class NoRippleCheck_test : public beast::unit_test::suite
|
||||
if (! user)
|
||||
{
|
||||
BEAST_EXPECT (txs[0u][jss::Account] == alice.human());
|
||||
BEAST_EXPECT (txs[0u][jss::TransactionType] == "AccountSet");
|
||||
BEAST_EXPECT (txs[0u][jss::TransactionType] == jss::AccountSet);
|
||||
}
|
||||
|
||||
BEAST_EXPECT (
|
||||
@@ -216,7 +216,7 @@ class NoRippleCheck_test : public beast::unit_test::suite
|
||||
alice.human());
|
||||
BEAST_EXPECT (
|
||||
result[jss::transactions][txs.size()-1][jss::TransactionType] ==
|
||||
"TrustSet");
|
||||
jss::TrustSet);
|
||||
BEAST_EXPECT (
|
||||
result[jss::transactions][txs.size()-1][jss::LimitAmount] ==
|
||||
gw["USD"](100).value ().getJson (0));
|
||||
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
[&](auto const& jv)
|
||||
{
|
||||
return jv[jss::transaction][jss::TransactionType] ==
|
||||
"AccountSet";
|
||||
jss::AccountSet;
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ class TransactionEntry_test : public beast::unit_test::suite
|
||||
env.close();
|
||||
|
||||
check_tx(env.closed()->seq(), trust_tx);
|
||||
check_tx(env.closed()->seq(), pay_tx, "Payment");
|
||||
check_tx(env.closed()->seq(), pay_tx, jss::Payment.c_str());
|
||||
|
||||
env(offer(A2, XRP(100), A2["USD"](1)));
|
||||
auto offer_tx =
|
||||
@@ -238,7 +238,7 @@ class TransactionEntry_test : public beast::unit_test::suite
|
||||
|
||||
env.close();
|
||||
|
||||
check_tx(env.closed()->seq(), offer_tx, "OfferCreate");
|
||||
check_tx(env.closed()->seq(), offer_tx, jss::OfferCreate.c_str());
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
@@ -125,10 +125,10 @@ class TransactionHistory_test : public beast::unit_test::suite
|
||||
}
|
||||
}
|
||||
BEAST_EXPECT(total == 117);
|
||||
BEAST_EXPECT(typeCounts["AccountSet"] == 20);
|
||||
BEAST_EXPECT(typeCounts["TrustSet"] == 19);
|
||||
BEAST_EXPECT(typeCounts["Payment"] == 58);
|
||||
BEAST_EXPECT(typeCounts["OfferCreate"] == 20);
|
||||
BEAST_EXPECT(typeCounts[jss::AccountSet.c_str()] == 20);
|
||||
BEAST_EXPECT(typeCounts[jss::TrustSet.c_str()] == 19);
|
||||
BEAST_EXPECT(typeCounts[jss::Payment.c_str()] == 58);
|
||||
BEAST_EXPECT(typeCounts[jss::OfferCreate.c_str()] == 20);
|
||||
|
||||
// also, try a request with max non-admin start value
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user