Replace more string literals

This commit is contained in:
Bart
2026-05-08 09:34:57 -04:00
parent adf75020c4
commit 96ec754e0c
4 changed files with 15 additions and 17 deletions

View File

@@ -216,7 +216,6 @@ xrpl.conditions > xrpl.basics
xrpl.conditions > xrpl.protocol
xrpl.config > xrpl.basics
xrpl.core > xrpl.basics
xrpl.core > xrpl.config
xrpl.core > xrpl.json
xrpl.core > xrpl.protocol
xrpl.json > xrpl.basics
@@ -226,7 +225,6 @@ xrpl.ledger > xrpl.server
xrpl.ledger > xrpl.shamap
xrpl.net > xrpl.basics
xrpl.nodestore > xrpl.basics
xrpl.nodestore > xrpl.config
xrpl.nodestore > xrpl.protocol
xrpl.protocol > xrpl.basics
xrpl.protocol > xrpl.json
@@ -239,7 +237,6 @@ xrpl.resource > xrpl.basics
xrpl.resource > xrpl.json
xrpl.resource > xrpl.protocol
xrpl.server > xrpl.basics
xrpl.server > xrpl.config
xrpl.server > xrpl.core
xrpl.server > xrpl.json
xrpl.server > xrpl.protocol

View File

@@ -119,6 +119,7 @@ struct Keys
static constexpr auto kMAX_UNKNOWN_TIME = "max_unknown_time";
static constexpr auto kMEMORY_LEVEL = "memory_level";
static constexpr auto kMIN_LEDGERS_TO_COMPUTE_SIZE_LIMIT = "min_ledgers_to_compute_size_limit";
static constexpr auto kMINIMUM_ESCALATION_MULTIPLIER = "minimum_escalation_multiplier";
static constexpr auto kMINIMUM_QUEUE_SIZE = "minimum_queue_size";
static constexpr auto kMINIMUM_TXN_IN_LEDGER = "minimum_txn_in_ledger";
static constexpr auto kMINIMUM_TXN_IN_LEDGER_STANDALONE = "minimum_txn_in_ledger_standalone";

View File

@@ -1873,15 +1873,15 @@ setupTxQ(Config const& config)
{
TxQ::Setup setup;
auto const& section = config.section(Sections::kTRANSACTION_QUEUE);
set(setup.ledgersInQueue, "ledgers_in_queue", section);
set(setup.queueSizeMin, "minimum_queue_size", section);
set(setup.retrySequencePercent, "retry_sequence_percent", section);
set(setup.minimumEscalationMultiplier, "minimum_escalation_multiplier", section);
set(setup.minimumTxnInLedger, "minimum_txn_in_ledger", section);
set(setup.minimumTxnInLedgerSA, "minimum_txn_in_ledger_standalone", section);
set(setup.targetTxnInLedger, "target_txn_in_ledger", section);
set(setup.ledgersInQueue, Keys::kLEDGERS_IN_QUEUE, section);
set(setup.queueSizeMin, Keys::kMINIMUM_QUEUE_SIZE, section);
set(setup.retrySequencePercent, Keys::kRETRY_SEQUENCE_PERCENT, section);
set(setup.minimumEscalationMultiplier, Keys::kMINIMUM_ESCALATION_MULTIPLIER, section);
set(setup.minimumTxnInLedger, Keys::kMINIMUM_TXN_IN_LEDGER, section);
set(setup.minimumTxnInLedgerSA, Keys::kMINIMUM_TXN_IN_LEDGER_STANDALONE, section);
set(setup.targetTxnInLedger, Keys::kTARGET_TXN_IN_LEDGER, section);
std::uint32_t max = 0;
if (set(max, "maximum_txn_in_ledger", section))
if (set(max, Keys::kMAXIMUM_TXN_IN_LEDGER, section))
{
if (max < setup.minimumTxnInLedger)
{
@@ -1909,7 +1909,7 @@ setupTxQ(Config const& config)
moot. (There are other ways to do that, including
minimum_txn_in_ledger_.)
*/
set(setup.normalConsensusIncreasePercent, "normal_consensus_increase_percent", section);
set(setup.normalConsensusIncreasePercent, Keys::kNORMAL_CONSENSUS_INCREASE_PERCENT, section);
setup.normalConsensusIncreasePercent =
std::clamp(setup.normalConsensusIncreasePercent, 0u, 1000u);
@@ -1917,11 +1917,11 @@ setupTxQ(Config const& config)
are nonsensical (uint overflows happen, so the limit grows
instead of shrinking). 0 is not recommended.
*/
set(setup.slowConsensusDecreasePercent, "slow_consensus_decrease_percent", section);
set(setup.slowConsensusDecreasePercent, Keys::kSLOW_CONSENSUS_DECREASE_PERCENT, section);
setup.slowConsensusDecreasePercent = std::clamp(setup.slowConsensusDecreasePercent, 0u, 100u);
set(setup.maximumTxnPerAccount, "maximum_txn_per_account", section);
set(setup.minimumLastLedgerBuffer, "minimum_last_ledger_buffer", section);
set(setup.maximumTxnPerAccount, Keys::kMAXIMUM_TXN_PER_ACCOUNT, section);
set(setup.minimumLastLedgerBuffer, Keys::kMINIMUM_LAST_LEDGER_BUFFER, section);
setup.standAlone = config.standalone();
return setup;

View File

@@ -23,7 +23,7 @@ setupHashRouter(Config const& config)
std::int32_t tmp{};
if (set(tmp, "hold_time", section))
if (set(tmp, Keys::kHOLD_TIME, section))
{
if (tmp < 12)
{
@@ -33,7 +33,7 @@ setupHashRouter(Config const& config)
}
setup.holdTime = seconds(tmp);
}
if (set(tmp, "relay_time", section))
if (set(tmp, Keys::kRELAY_TIME, section))
{
if (tmp < 8)
{