mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-06 02:06:46 +00:00
XRP -> XAH (#134)
* `XRP` -> `XAH` * update rpc * fix badCurrency * revert consensus update * `xah` -> `native` in rpc commands * Update Consensus.h
This commit is contained in:
@@ -2658,6 +2658,11 @@ NetworkOPsImp::getServerInfo(bool human, bool admin, bool counters)
|
||||
lpClosed->fees().accountReserve(0).decimalXRP();
|
||||
l[jss::reserve_inc_xrp] = lpClosed->fees().increment.decimalXRP();
|
||||
|
||||
l[jss::base_fee_native] = baseFee.decimalXRP();
|
||||
l[jss::reserve_base_native] =
|
||||
lpClosed->fees().accountReserve(0).decimalXRP();
|
||||
l[jss::reserve_inc_native] = lpClosed->fees().increment.decimalXRP();
|
||||
|
||||
auto const nowOffset = app_.timeKeeper().nowOffset();
|
||||
if (std::abs(nowOffset.count()) >= 60)
|
||||
l[jss::system_time_offset] = nowOffset.count();
|
||||
|
||||
@@ -858,7 +858,9 @@ OverlayImpl::getServerInfo()
|
||||
|
||||
validated_ledger.removeMember(jss::base_fee);
|
||||
validated_ledger.removeMember(jss::reserve_base_xrp);
|
||||
validated_ledger.removeMember(jss::reserve_base_native);
|
||||
validated_ledger.removeMember(jss::reserve_inc_xrp);
|
||||
validated_ledger.removeMember(jss::reserve_inc_native);
|
||||
}
|
||||
|
||||
return server_info;
|
||||
|
||||
@@ -61,7 +61,7 @@ isLegalAmountSigned(XRPAmount const& amount)
|
||||
static inline std::string const&
|
||||
systemCurrencyCode()
|
||||
{
|
||||
static std::string const code = "XRP";
|
||||
static std::string const code = "XAH";
|
||||
return code;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ xrpCurrency();
|
||||
Currency const&
|
||||
noCurrency();
|
||||
|
||||
/** We deliberately disallow the currency that looks like "XRP" because too
|
||||
/** We deliberately disallow the currency that looks like "XAH" because too
|
||||
many people were using it instead of the correct XRP currency. */
|
||||
Currency const&
|
||||
badCurrency();
|
||||
@@ -83,7 +83,7 @@ isFakeXRP(Currency const& c)
|
||||
return c == badCurrency();
|
||||
}
|
||||
|
||||
/** Returns "", "XRP", or three letter ISO code. */
|
||||
/** Returns "", "XAH", or three letter ISO code. */
|
||||
std::string
|
||||
to_string(Currency const& c);
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ noCurrency()
|
||||
Currency const&
|
||||
badCurrency()
|
||||
{
|
||||
static Currency const currency(0x5852500000000000);
|
||||
static Currency const currency(0x5841480000000000);
|
||||
return currency;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ JSS(balances); // out: GatewayBalances
|
||||
JSS(base); // out: LogLevel
|
||||
JSS(base_fee); // out: NetworkOPs
|
||||
JSS(base_fee_xrp); // out: NetworkOPs
|
||||
JSS(base_fee_native); // out: NetworkOPs
|
||||
JSS(bids); // out: Subscribe
|
||||
JSS(binary); // in: AccountTX, LedgerEntry,
|
||||
// AccountTxOld, Tx LedgerData
|
||||
@@ -563,8 +564,10 @@ JSS(requested); // out: Manifest
|
||||
JSS(reservations); // out: Reservations
|
||||
JSS(reserve_base); // out: NetworkOPs
|
||||
JSS(reserve_base_xrp); // out: NetworkOPs
|
||||
JSS(reserve_base_native); // out: NetworkOPs
|
||||
JSS(reserve_inc); // out: NetworkOPs
|
||||
JSS(reserve_inc_xrp); // out: NetworkOPs
|
||||
JSS(reserve_inc_native); // out: NetworkOPs
|
||||
JSS(response); // websocket
|
||||
JSS(result); // RPC
|
||||
JSS(ripple_lines); // out: NetworkOPs
|
||||
|
||||
@@ -269,7 +269,7 @@ class Freeze_test : public beast::unit_test::suite
|
||||
auto offers = env.rpc(
|
||||
"book_offers",
|
||||
std::string("USD/") + G1.human(),
|
||||
"XRP")[jss::result][jss::offers];
|
||||
"XAH")[jss::result][jss::offers];
|
||||
if (!BEAST_EXPECT(checkArraySize(offers, 2u)))
|
||||
return;
|
||||
std::set<std::string> accounts;
|
||||
@@ -283,7 +283,7 @@ class Freeze_test : public beast::unit_test::suite
|
||||
// test: visible offers where taker_gets is unfrozen issuer
|
||||
offers = env.rpc(
|
||||
"book_offers",
|
||||
"XRP",
|
||||
"XAH",
|
||||
std::string("USD/") + G1.human())[jss::result][jss::offers];
|
||||
if (!BEAST_EXPECT(checkArraySize(offers, 2u)))
|
||||
return;
|
||||
@@ -344,7 +344,7 @@ class Freeze_test : public beast::unit_test::suite
|
||||
// (should these actually be filtered?)
|
||||
offers = env.rpc(
|
||||
"book_offers",
|
||||
"XRP",
|
||||
"XAH",
|
||||
std::string("USD/") + G1.human())[jss::result][jss::offers];
|
||||
if (!BEAST_EXPECT(checkArraySize(offers, 2u)))
|
||||
return;
|
||||
@@ -352,7 +352,7 @@ class Freeze_test : public beast::unit_test::suite
|
||||
offers = env.rpc(
|
||||
"book_offers",
|
||||
std::string("USD/") + G1.human(),
|
||||
"XRP")[jss::result][jss::offers];
|
||||
"XAH")[jss::result][jss::offers];
|
||||
if (!BEAST_EXPECT(checkArraySize(offers, 2u)))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1930,7 +1930,7 @@ public:
|
||||
env(offer(dan, XRP(500), EUR(50)));
|
||||
|
||||
Json::Value jtp{Json::arrayValue};
|
||||
jtp[0u][0u][jss::currency] = "XRP";
|
||||
jtp[0u][0u][jss::currency] = "XAH";
|
||||
env(pay(alice, bob, EUR(30)), json(jss::Paths, jtp), sendmax(USD(333)));
|
||||
|
||||
auto jrr = ledgerEntryState(env, alice, gw1, "USD");
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
// Check for things which contain some or only invalid characters
|
||||
testUnHexFailure("123X");
|
||||
testUnHexFailure("V");
|
||||
testUnHexFailure("XRP");
|
||||
testUnHexFailure("XAH");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
unexpected(STAmount().getText() != "0", "STAmount fail");
|
||||
unexpected(STAmount(31).getText() != "31", "STAmount fail");
|
||||
unexpected(STAmount(310).getText() != "310", "STAmount fail");
|
||||
unexpected(to_string(Currency()) != "XRP", "cHC(XRP)");
|
||||
unexpected(to_string(Currency()) != "XAH", "cHC(XAH)");
|
||||
Currency c;
|
||||
unexpected(!to_currency(c, "USD"), "create USD currency");
|
||||
unexpected(to_string(c) != "USD", "check USD currency");
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::both] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::both] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -437,7 +437,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -562,7 +562,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -687,7 +687,7 @@ public:
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::both] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -834,7 +834,7 @@ public:
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::both] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = Account("alice").human();
|
||||
}
|
||||
@@ -992,7 +992,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = true;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = gw.human();
|
||||
}
|
||||
@@ -1026,7 +1026,7 @@ public:
|
||||
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::taker] = env.master.human();
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
@@ -1201,7 +1201,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = false;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = gw.human();
|
||||
}
|
||||
@@ -1277,7 +1277,7 @@ public:
|
||||
{
|
||||
auto& j = books[jss::books].append(Json::objectValue);
|
||||
j[jss::snapshot] = false;
|
||||
j[jss::taker_gets][jss::currency] = "XRP";
|
||||
j[jss::taker_gets][jss::currency] = "XAH";
|
||||
j[jss::taker_pays][jss::currency] = "USD";
|
||||
j[jss::taker_pays][jss::issuer] = gw.human();
|
||||
}
|
||||
@@ -1287,7 +1287,7 @@ public:
|
||||
j[jss::snapshot] = false;
|
||||
j[jss::taker_gets][jss::currency] = "EUR";
|
||||
j[jss::taker_gets][jss::issuer] = gw.human();
|
||||
j[jss::taker_pays][jss::currency] = "XRP";
|
||||
j[jss::taker_pays][jss::currency] = "XAH";
|
||||
}
|
||||
|
||||
auto jv = wsc->invoke("subscribe", books);
|
||||
@@ -1403,7 +1403,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets] = Json::objectValue;
|
||||
auto const jrr = env.rpc(
|
||||
"json", "book_offers", to_string(jvParams))[jss::result];
|
||||
@@ -1416,7 +1416,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = 1;
|
||||
auto const jrr = env.rpc(
|
||||
"json", "book_offers", to_string(jvParams))[jss::result];
|
||||
@@ -1430,7 +1430,7 @@ public:
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "NOT_VALID";
|
||||
jvParams[jss::taker_gets][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_gets][jss::currency] = "XAH";
|
||||
auto const jrr = env.rpc(
|
||||
"json", "book_offers", to_string(jvParams))[jss::result];
|
||||
BEAST_EXPECT(jrr[jss::error] == "srcCurMalformed");
|
||||
@@ -1442,7 +1442,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "NOT_VALID";
|
||||
auto const jrr = env.rpc(
|
||||
"json", "book_offers", to_string(jvParams))[jss::result];
|
||||
@@ -1455,7 +1455,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = 1;
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1469,7 +1469,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_pays][jss::issuer] = 1;
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1483,7 +1483,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_pays][jss::issuer] = gw.human() + "DEAD";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1497,7 +1497,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_pays][jss::issuer] = toBase58(noAccount());
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1511,7 +1511,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human() + "DEAD";
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1525,7 +1525,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = toBase58(noAccount());
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1539,7 +1539,7 @@ public:
|
||||
{
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_pays][jss::issuer] = alice.human();
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
@@ -1571,7 +1571,7 @@ public:
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker] = 1;
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1586,7 +1586,7 @@ public:
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker] = env.master.human() + "DEAD";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1614,7 +1614,7 @@ public:
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker] = env.master.human();
|
||||
jvParams[jss::limit] = "0"; // NOT an integer
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
auto const jrr = env.rpc(
|
||||
@@ -1645,7 +1645,7 @@ public:
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "USD";
|
||||
jvParams[jss::taker_pays][jss::issuer] = gw.human();
|
||||
jvParams[jss::taker_gets][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_gets][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
auto const jrr = env.rpc(
|
||||
"json", "book_offers", to_string(jvParams))[jss::result];
|
||||
@@ -1680,7 +1680,7 @@ public:
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::limit] = 1;
|
||||
jvParams[jss::ledger_index] = "validated";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XRP";
|
||||
jvParams[jss::taker_pays][jss::currency] = "XAH";
|
||||
jvParams[jss::taker_gets][jss::currency] = "USD";
|
||||
jvParams[jss::taker_gets][jss::issuer] = gw.human();
|
||||
auto jrr =
|
||||
|
||||
Reference in New Issue
Block a user