mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-28 17:40:10 +00:00
Fix genesis feesettings NetworkiD (#649)
This commit is contained in:
@@ -220,7 +220,10 @@ Ledger::Ledger(
|
||||
|
||||
{
|
||||
auto sle = std::make_shared<SLE>(keylet::fees());
|
||||
sle->setFieldU32(sfNetworkID, config.NETWORK_ID);
|
||||
|
||||
uint32_t networkID = config.NETWORK_ID;
|
||||
if (networkID > 1024)
|
||||
sle->setFieldU32(sfNetworkID, networkID);
|
||||
|
||||
// Whether featureXRPFees is supported will depend on startup options.
|
||||
if (std::find(amendments.begin(), amendments.end(), featureXRPFees) !=
|
||||
|
||||
@@ -1520,7 +1520,7 @@ public:
|
||||
"bob: "s + std::to_string(bobSeq) + ", " +
|
||||
std::to_string(env.seq(bob)));
|
||||
BEAST_EXPECTS(
|
||||
charlieSeq + 1 == env.seq(charlie),
|
||||
charlieSeq == env.seq(charlie),
|
||||
"charlie: "s + std::to_string(charlieSeq) + ", " +
|
||||
std::to_string(env.seq(charlie)));
|
||||
BEAST_EXPECTS(
|
||||
@@ -1528,7 +1528,7 @@ public:
|
||||
"daria: "s + std::to_string(dariaSeq) + ", " +
|
||||
std::to_string(env.seq(daria)));
|
||||
BEAST_EXPECTS(
|
||||
elmoSeq == env.seq(elmo),
|
||||
elmoSeq + 1 == env.seq(elmo),
|
||||
"elmo: "s + std::to_string(elmoSeq) + ", " +
|
||||
std::to_string(env.seq(elmo)));
|
||||
BEAST_EXPECTS(
|
||||
@@ -1544,18 +1544,25 @@ public:
|
||||
"hank: "s + std::to_string(hankSeq) + ", " +
|
||||
std::to_string(env.seq(hank)));
|
||||
|
||||
// Which sequences get incremented may change
|
||||
// Match the below with the above. If + 1 then ++
|
||||
// Which sequences get incremented may change if TxQ ordering is
|
||||
// changed
|
||||
++aliceSeq;
|
||||
// ++bobSeq;
|
||||
// ++(++charlieSeq);
|
||||
++charlieSeq;
|
||||
++dariaSeq;
|
||||
// ++elmoSeq;
|
||||
++elmoSeq;
|
||||
++fredSeq;
|
||||
++gwenSeq;
|
||||
++hankSeq;
|
||||
|
||||
// std::cout << "bobSeq: " << ++bobSeq << "\n";
|
||||
// std::cout << "charlieSeq: " << ++(++charlieSeq) << "\n";
|
||||
// std::cout << "dariaSeq: " << ++dariaSeq << "\n";
|
||||
// std::cout << "elmoSeq: " << ++elmoSeq << "\n";
|
||||
// std::cout << "fredSeq: " << ++fredSeq << "\n";
|
||||
// std::cout << "gwenSeq: " << ++gwenSeq << "\n";
|
||||
// std::cout << "hankSeq: " << ++hankSeq << "\n";
|
||||
|
||||
auto getTxsQueued = [&]() {
|
||||
auto const txs = env.app().getTxQ().getTxs();
|
||||
std::map<AccountID, std::size_t> result;
|
||||
@@ -3029,7 +3036,15 @@ public:
|
||||
// may not reduce to 8.
|
||||
env.close();
|
||||
checkMetrics(__LINE__, env, 9, 50, 6, 5, 256);
|
||||
BEAST_EXPECT(env.seq(alice) == aliceSeq + 17);
|
||||
|
||||
// env.seq(alice): 17, aliceSeq + 15: 18
|
||||
/*std::cout
|
||||
<< "env.seq(alice): "
|
||||
<< env.seq(alice)
|
||||
<< ", aliceSeq + 15: "
|
||||
<< (aliceSeq + 15) << "\n";
|
||||
*/
|
||||
BEAST_EXPECT(env.seq(alice) == aliceSeq + 15);
|
||||
|
||||
// Close ledger 7. That should remove 7 more of alice's transactions.
|
||||
env.close();
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
auto lc_result = env.rpc("ledger_closed")[jss::result];
|
||||
BEAST_EXPECT(
|
||||
lc_result[jss::ledger_hash] ==
|
||||
"2E6983FE0D18F04568199D75E8E69503E747A24CE8814CF1FAD638CF6DF8FBDC");
|
||||
"CCC3B3E88CCAC17F1BE6B4A648A55999411F19E3FE55EB721960EB0DF28EDDA5");
|
||||
BEAST_EXPECT(lc_result[jss::ledger_index] == 2);
|
||||
|
||||
env.close();
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
lc_result = env.rpc("ledger_closed")[jss::result];
|
||||
BEAST_EXPECT(
|
||||
lc_result[jss::ledger_hash] ==
|
||||
"D39C52DE7CBF561ECA875A6D636B7C9095408DE1FAF4EC4AAF3FDD8AB3A1EA55");
|
||||
"E86DE7F3D7A4D9CE17EF7C8BA08A8F4D8F643B9552F0D895A31CDA78F541DE4E");
|
||||
BEAST_EXPECT(lc_result[jss::ledger_index] == 3);
|
||||
}
|
||||
|
||||
|
||||
@@ -2023,8 +2023,8 @@ public:
|
||||
// access via the ledger_hash field
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::ledger_hash] =
|
||||
"D39C52DE7CBF561ECA875A6D636B7C9095408DE1FAF4EC4AAF3FDD8AB3A1EA"
|
||||
"55";
|
||||
"E86DE7F3D7A4D9CE17EF7C8BA08A8F4D"
|
||||
"8F643B9552F0D895A31CDA78F541DE4E";
|
||||
auto jrr = env.rpc(
|
||||
"json",
|
||||
"ledger",
|
||||
@@ -2249,7 +2249,7 @@ public:
|
||||
if (BEAST_EXPECT(jrr[jss::queue_data].size() == 2))
|
||||
{
|
||||
const std::string txid1 = [&]() {
|
||||
auto const& txj = jrr[jss::queue_data][0u];
|
||||
auto const& txj = jrr[jss::queue_data][1u];
|
||||
BEAST_EXPECT(txj[jss::account] == alice.human());
|
||||
BEAST_EXPECT(txj[jss::fee_level] == "256");
|
||||
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
|
||||
@@ -2261,7 +2261,7 @@ public:
|
||||
return tx[jss::hash].asString();
|
||||
}();
|
||||
|
||||
auto const& txj = jrr[jss::queue_data][1u];
|
||||
auto const& txj = jrr[jss::queue_data][0u];
|
||||
BEAST_EXPECT(txj[jss::account] == alice.human());
|
||||
BEAST_EXPECT(txj[jss::fee_level] == "256");
|
||||
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
|
||||
@@ -2274,7 +2274,7 @@ public:
|
||||
uint256 tx0, tx1;
|
||||
BEAST_EXPECT(tx0.parseHex(txid0));
|
||||
BEAST_EXPECT(tx1.parseHex(txid1));
|
||||
BEAST_EXPECT((tx1 ^ parentHash) < (tx0 ^ parentHash));
|
||||
BEAST_EXPECT((tx0 ^ parentHash) < (tx1 ^ parentHash));
|
||||
return txid0;
|
||||
}
|
||||
return std::string{};
|
||||
@@ -2289,14 +2289,14 @@ public:
|
||||
{
|
||||
auto const& parentHash = env.current()->info().parentHash;
|
||||
auto const txid1 = [&]() {
|
||||
auto const& txj = jrr[jss::queue_data][0u];
|
||||
auto const& txj = jrr[jss::queue_data][1u];
|
||||
BEAST_EXPECT(txj[jss::account] == alice.human());
|
||||
BEAST_EXPECT(txj[jss::fee_level] == "256");
|
||||
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
|
||||
BEAST_EXPECT(txj.isMember(jss::tx));
|
||||
return txj[jss::tx].asString();
|
||||
}();
|
||||
auto const& txj = jrr[jss::queue_data][1u];
|
||||
auto const& txj = jrr[jss::queue_data][0u];
|
||||
BEAST_EXPECT(txj[jss::account] == alice.human());
|
||||
BEAST_EXPECT(txj[jss::fee_level] == "256");
|
||||
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
|
||||
@@ -2307,7 +2307,7 @@ public:
|
||||
uint256 tx0, tx1;
|
||||
BEAST_EXPECT(tx0.parseHex(txid0));
|
||||
BEAST_EXPECT(tx1.parseHex(txid1));
|
||||
BEAST_EXPECT((tx1 ^ parentHash) < (tx0 ^ parentHash));
|
||||
BEAST_EXPECT((tx0 ^ parentHash) < (tx1 ^ parentHash));
|
||||
}
|
||||
|
||||
env.close();
|
||||
@@ -2318,7 +2318,7 @@ public:
|
||||
jrr = env.rpc("json", "ledger", to_string(jv))[jss::result];
|
||||
if (BEAST_EXPECT(jrr[jss::queue_data].size() == 2))
|
||||
{
|
||||
auto const& txj = jrr[jss::queue_data][1u];
|
||||
auto const& txj = jrr[jss::queue_data][0u];
|
||||
BEAST_EXPECT(txj[jss::account] == alice.human());
|
||||
BEAST_EXPECT(txj[jss::fee_level] == "256");
|
||||
BEAST_EXPECT(txj["preflight_result"] == "tesSUCCESS");
|
||||
@@ -2327,7 +2327,7 @@ public:
|
||||
BEAST_EXPECT(txj.isMember(jss::tx));
|
||||
BEAST_EXPECT(txj[jss::tx].isMember(jss::tx_blob));
|
||||
|
||||
auto const& txj2 = jrr[jss::queue_data][0u];
|
||||
auto const& txj2 = jrr[jss::queue_data][1u];
|
||||
BEAST_EXPECT(txj2[jss::account] == alice.human());
|
||||
BEAST_EXPECT(txj2[jss::fee_level] == "256");
|
||||
BEAST_EXPECT(txj2["preflight_result"] == "tesSUCCESS");
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace RPC {
|
||||
class LedgerRequestRPC_test : public beast::unit_test::suite
|
||||
{
|
||||
static constexpr char const* hash1 =
|
||||
"3C570BEB083CBFC17ED614A7404E25ED84C5CF44E5826944FBE8DD20FCCE67FE";
|
||||
"3020EB9E7BE24EF7D7A060CB051583EC117384636D1781AFB5B87F3E348DA489";
|
||||
static constexpr char const* accounthash1 =
|
||||
"BD91A0C42F0055CAE81D0C0D6E47629C34B6528E380EA2D1BB9FEFFDC879480E";
|
||||
"BD8A3D72CA73DDE887AD63666EC2BAD07875CBA997A102579B5B95ECDFFEAED8";
|
||||
|
||||
static constexpr char const* zerohash =
|
||||
"0000000000000000000000000000000000000000000000000000000000000000";
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
|
||||
result = env.rpc("ledger_request", "2")[jss::result];
|
||||
constexpr char const* hash2 =
|
||||
"2E6983FE0D18F04568199D75E8E69503E747A24CE8814CF1FAD638CF6DF8FBDC";
|
||||
"CCC3B3E88CCAC17F1BE6B4A648A55999411F19E3FE55EB721960EB0DF28EDDA5";
|
||||
BEAST_EXPECT(result[jss::ledger][jss::ledger_index] == "2");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::total_coins] == "100000000000000000");
|
||||
@@ -205,12 +205,12 @@ public:
|
||||
BEAST_EXPECT(result[jss::ledger][jss::parent_hash] == hash1);
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::account_hash] ==
|
||||
"C6C885F43A772BA455AB96456248D10D2B32E32C24377520D6B7652F3FCEEF31");
|
||||
"3C834285F7F464FBE99AFEB84D354A968EB2CAA24523FF26797A973D906A3D29");
|
||||
BEAST_EXPECT(result[jss::ledger][jss::transaction_hash] == zerohash);
|
||||
|
||||
result = env.rpc("ledger_request", "3")[jss::result];
|
||||
constexpr char const* hash3 =
|
||||
"6E82AE402A91025406F4A0FBC5E228CC8FE2CA6EE07B4195ED59ACA332DCECF7";
|
||||
"8D631B20BC989AF568FBA97375290544B0703A5ADC1CF9E9053580461690C9EE";
|
||||
BEAST_EXPECT(result[jss::ledger][jss::ledger_index] == "3");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::total_coins] == "99999999999999980");
|
||||
@@ -219,14 +219,14 @@ public:
|
||||
BEAST_EXPECT(result[jss::ledger][jss::parent_hash] == hash2);
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::account_hash] ==
|
||||
"692A26D06FCB0A2685F6DC269A08713E9FD8583056B2E4928CCE76862763609D");
|
||||
"BC9EF2A16BFF80BCFABA6FA84688D858D33BD0FA0435CAA9DF6DA4105A39A29E");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::transaction_hash] ==
|
||||
"0213EC486C058B3942FBE3DAC6839949A5C5B02B8B4244C8998EFDF04DBD8222");
|
||||
|
||||
result = env.rpc("ledger_request", "4")[jss::result];
|
||||
constexpr char const* hash4 =
|
||||
"CDFFFA5ED6AC9D45C4863F41F3AD37432FEDE592AB987FF49D6B272E69F68559";
|
||||
"1A8E7098B23597E73094DADA58C9D62F3AB93A12C6F7666D56CA85A6CFDE530F";
|
||||
BEAST_EXPECT(result[jss::ledger][jss::ledger_index] == "4");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::total_coins] == "99999999999999960");
|
||||
@@ -235,14 +235,14 @@ public:
|
||||
BEAST_EXPECT(result[jss::ledger][jss::parent_hash] == hash3);
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::account_hash] ==
|
||||
"D6DF68C04B663B45F159AA87072479C54B3930E92E8965154C35A80D508BF958");
|
||||
"C690188F123C91355ADA8BDF4AC5B5C927076D3590C215096868A5255264C6DD");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::transaction_hash] ==
|
||||
"3CBDB8F42E04333E1642166BFB93AC9A7E1C6C067092CD5D881D6F3AB3D67E76");
|
||||
|
||||
result = env.rpc("ledger_request", "5")[jss::result];
|
||||
constexpr char const* hash5 =
|
||||
"DE428CD76D4E0372C1ED6019BD49F6F8095596260E6011C51385B2C510F4C1D4";
|
||||
"C6A222D71AE65D7B4F240009EAD5DEB20D7EEDE5A4064F28BBDBFEEB6FBE48E5";
|
||||
BEAST_EXPECT(result[jss::ledger][jss::ledger_index] == "5");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::total_coins] == "99999999999999940");
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
BEAST_EXPECT(result[jss::ledger][jss::parent_hash] == hash4);
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::account_hash] ==
|
||||
"6A1179D2AD9ACDF61E14A076B6FBE305FF032D2193D230DE21BF9358C7E11F09");
|
||||
"EA81CD9D36740736F00CB747E0D0E32D3C10B695823D961F0FB9A1CE7133DD4D");
|
||||
BEAST_EXPECT(
|
||||
result[jss::ledger][jss::transaction_hash] ==
|
||||
"C3D086CD6BDB9E97AD1D513B2C049EF2840BD21D0B3E22D84EBBB89B6D2EF59D");
|
||||
|
||||
Reference in New Issue
Block a user