Skip to content
4 changes: 2 additions & 2 deletions include/xrpl/ledger/helpers/EscrowHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ escrowUnlockApplyHelper<Issue>(
beast::Journal journal)
{
Issue const& issue = amount.get<Issue>();
Keylet const trustLineKey = keylet::line(receiver, issue);
Keylet const trustLineKey = keylet::rippleState(receiver, issue);
bool const recvLow = issuer > receiver;
bool const senderIssuer = issuer == sender;
bool const receiverIssuer = issuer == receiver;
Expand Down Expand Up @@ -175,7 +175,7 @@ escrowUnlockApplyHelper<MPTIssue>(
bool const receiverIssuer = issuer == receiver;

auto const mptID = amount.get<MPTIssue>().getMptID();
auto const issuanceKey = keylet::mptIssuance(mptID);
auto const issuanceKey = keylet::mptokenIssuance(mptID);
if (!view.exists(keylet::mptoken(issuanceKey.key, receiver)) && createAsset && !receiverIssuer)
{
if (std::uint32_t const ownerCount = {sleDest->at(sfOwnerCount)};
Expand Down
42 changes: 23 additions & 19 deletions include/xrpl/protocol/Indexes.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ skip(LedgerIndex ledger) noexcept;

/** The (fixed) index of the object containing the ledger fees. */
Keylet const&
fees() noexcept;
feeSettings() noexcept;

/** The (fixed) index of the object containing the ledger negativeUNL. */
Keylet const&
Expand All @@ -93,12 +93,12 @@ static book_t const book{};
*/
/** @{ */
Keylet
line(AccountID const& id0, AccountID const& id1, Currency const& currency) noexcept;
rippleState(AccountID const& id0, AccountID const& id1, Currency const& currency) noexcept;

inline Keylet
line(AccountID const& id, Issue const& issue) noexcept
rippleState(AccountID const& id, Issue const& issue) noexcept
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename this to trustLine? While rippleState is the official object name, everywhere else it's referred to as trustline.

{
return line(id, issue.account, issue.currency);
return rippleState(id, issue.account, issue.currency);
}
Comment on lines 69 to 102
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says these are “internal names” with “API Impact: N/A”, but this file is part of the installed/packaged public headers (see cmake/XrplInstall.cmake:35-39 and conanfile.py:144-151). Renaming exported keylet functions like fees/line/signers to feeSettings/rippleState/signerList is therefore a breaking API change for downstream consumers; please update the PR description/API impact accordingly and consider keeping deprecated compatibility wrappers (e.g., [[deprecated]] aliases) if backwards compatibility is required.

Copilot uses AI. Check for mistakes.
/** @} */

Expand Down Expand Up @@ -149,7 +149,7 @@ static ticket_t const ticket{};

/** A SignerList */
Keylet
signers(AccountID const& account) noexcept;
signerList(AccountID const& account) noexcept;

/** A Check */
/** @{ */
Expand Down Expand Up @@ -209,7 +209,7 @@ escrow(AccountID const& src, std::uint32_t seq) noexcept;

/** A PaymentChannel */
Keylet
payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept;
payChannel(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept;

/** NFT page keylets

Expand All @@ -221,22 +221,22 @@ payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept;
/** @{ */
/** A keylet for the owner's first possible NFT page. */
Keylet
nftpage_min(AccountID const& owner);
nftokenPage_min(AccountID const& owner);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be cammel case, as per the new clang-tidy rules.


/** A keylet for the owner's last possible NFT page. */
Keylet
nftpage_max(AccountID const& owner);
nftokenPage_max(AccountID const& owner);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, camel case


Keylet
nftpage(Keylet const& k, uint256 const& token);
nftokenPage(Keylet const& k, uint256 const& token);
/** @} */

/** An offer from an account to buy or sell an NFT */
Keylet
nftoffer(AccountID const& owner, std::uint32_t seq);
nftokenOffer(AccountID const& owner, std::uint32_t seq);

inline Keylet
nftoffer(uint256 const& offer)
nftokenOffer(uint256 const& offer)
{
return {ltNFTOKEN_OFFER, offer};
}
Expand Down Expand Up @@ -287,13 +287,13 @@ credential(uint256 const& key) noexcept
}

Keylet
mptIssuance(std::uint32_t seq, AccountID const& issuer) noexcept;
mptokenIssuance(std::uint32_t seq, AccountID const& issuer) noexcept;

Keylet
mptIssuance(MPTID const& issuanceID) noexcept;
mptokenIssuance(MPTID const& issuanceID) noexcept;

inline Keylet
mptIssuance(uint256 const& issuanceKey)
mptokenIssuance(uint256 const& issuanceKey)
{
return {ltMPTOKEN_ISSUANCE, issuanceKey};
}
Expand All @@ -320,10 +320,10 @@ vault(uint256 const& vaultKey)
}

Keylet
loanbroker(AccountID const& owner, std::uint32_t seq) noexcept;
loanBroker(AccountID const& owner, std::uint32_t seq) noexcept;

inline Keylet
loanbroker(uint256 const& key)
loanBroker(uint256 const& key)
{
return {ltLOAN_BROKER, key};
}
Expand Down Expand Up @@ -376,11 +376,15 @@ struct keyletDesc
std::array<keyletDesc<AccountID const&>, 6> const directAccountKeylets{
{{.function = &keylet::account, .expectedLEName = jss::AccountRoot, .includeInTests = false},
{.function = &keylet::ownerDir, .expectedLEName = jss::DirectoryNode, .includeInTests = true},
{.function = &keylet::signers, .expectedLEName = jss::SignerList, .includeInTests = true},
{.function = &keylet::signerList, .expectedLEName = jss::SignerList, .includeInTests = true},
// It's normally impossible to create an item at nftpage_min, but
// test it anyway, since the invariant checks for it.
{.function = &keylet::nftpage_min, .expectedLEName = jss::NFTokenPage, .includeInTests = true},
{.function = &keylet::nftpage_max, .expectedLEName = jss::NFTokenPage, .includeInTests = true},
{.function = &keylet::nftokenPage_min,
.expectedLEName = jss::NFTokenPage,
.includeInTests = true},
{.function = &keylet::nftokenPage_max,
.expectedLEName = jss::NFTokenPage,
.includeInTests = true},
{.function = &keylet::did, .expectedLEName = jss::DID, .includeInTests = true}}};

MPTID
Expand Down
16 changes: 8 additions & 8 deletions include/xrpl/protocol/detail/ledger_entries.macro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/** A ledger object which identifies an offer to buy or sell an NFT.

\sa keylet::nftoffer
\sa keylet::nftokenOffer
*/
LEDGER_ENTRY(ltNFTOKEN_OFFER, 0x0037, NFTokenOffer, nft_offer, ({
{sfOwner, soeREQUIRED},
Expand Down Expand Up @@ -84,7 +84,7 @@ LEDGER_ENTRY(ltNEGATIVE_UNL, 0x004e, NegativeUNL, nunl, ({

/** A ledger object which contains a list of NFTs

\sa keylet::nftpage_min, keylet::nftpage_max, keylet::nftpage
\sa keylet::nftokenPage_min, keylet::nftokenPage_max, keylet::nftokenPage
*/
LEDGER_ENTRY(ltNFTOKEN_PAGE, 0x0050, NFTokenPage, nft_page, ({
{sfPreviousPageMin, soeOPTIONAL},
Expand All @@ -96,7 +96,7 @@ LEDGER_ENTRY(ltNFTOKEN_PAGE, 0x0050, NFTokenPage, nft_page, ({

/** A ledger object which contains a signer list for an account.

\sa keylet::signers
\sa keylet::signerList
*/
// All fields are soeREQUIRED because there is always a SignerEntries.
// If there are no SignerEntries the node is deleted.
Expand Down Expand Up @@ -272,7 +272,7 @@ LEDGER_ENTRY(ltXCHAIN_OWNED_CLAIM_ID, 0x0071, XChainOwnedClaimID, xchain_owned_c

@note Per Vinnie Falco this should be renamed to ltTRUST_LINE

\sa keylet::line
\sa keylet::rippleState
*/
LEDGER_ENTRY(ltRIPPLE_STATE, 0x0072, RippleState, state, ({
{sfBalance, soeREQUIRED},
Expand All @@ -292,7 +292,7 @@ LEDGER_ENTRY(ltRIPPLE_STATE, 0x0072, RippleState, state, ({

\note This is a singleton: only one such object exists in the ledger.

\sa keylet::fees
\sa keylet::feeSettings
*/
LEDGER_ENTRY(ltFEE_SETTINGS, 0x0073, FeeSettings, fee, ({
// Old version uses raw numbers
Expand Down Expand Up @@ -346,7 +346,7 @@ LEDGER_ENTRY(ltESCROW, 0x0075, Escrow, escrow, ({

/** A ledger object describing a single unidirectional XRP payment channel.

\sa keylet::payChan
\sa keylet::payChannel
*/
LEDGER_ENTRY(ltPAYCHAN, 0x0078, PayChannel, payment_channel, ({
{sfAccount, soeREQUIRED},
Expand Down Expand Up @@ -384,7 +384,7 @@ LEDGER_ENTRY(ltAMM, 0x0079, AMM, amm, ({
}))

/** A ledger object which tracks MPTokenIssuance
\sa keylet::mptIssuance
\sa keylet::mptokenIssuance
*/
LEDGER_ENTRY(ltMPTOKEN_ISSUANCE, 0x007e, MPTokenIssuance, mpt_issuance, ({
{sfIssuer, soeREQUIRED},
Expand Down Expand Up @@ -498,7 +498,7 @@ LEDGER_ENTRY(ltVAULT, 0x0084, Vault, vault, ({

/** A ledger object representing a loan broker

\sa keylet::loanbroker
\sa keylet::loanBroker
*/
LEDGER_ENTRY(ltLOAN_BROKER, 0x0088, LoanBroker, loan_broker, ({
{sfPreviousTxnID, soeREQUIRED},
Expand Down
4 changes: 2 additions & 2 deletions include/xrpl/protocol/nft.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ getTransferFee(uint256 const& id)
}

inline std::uint32_t
getSerial(uint256 const& id)
getSequence(uint256 const& id)
{
std::uint32_t seq = 0;
memcpy(&seq, id.begin() + 28, 4);
Expand Down Expand Up @@ -92,7 +92,7 @@ getTaxon(uint256 const& id)

// The taxon cipher is just an XOR, so it is reversible by applying the
// XOR a second time.
return cipheredTaxon(getSerial(id), toTaxon(taxon));
return cipheredTaxon(getSequence(id), toTaxon(taxon));
}

inline AccountID
Expand Down
6 changes: 3 additions & 3 deletions include/xrpl/tx/paths/detail/StepChecks.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ checkFreeze(
}
}

if (auto sle = view.read(keylet::line(src, dst, currency)))
if (auto sle = view.read(keylet::rippleState(src, dst, currency)))
{
if (sle->isFlag((dst > src) ? lsfHighFreeze : lsfLowFreeze))
{
Expand Down Expand Up @@ -71,8 +71,8 @@ checkNoRipple(
beast::Journal j)
{
// fetch the ripple lines into and out of this node
auto sleIn = view.read(keylet::line(prev, cur, currency));
auto sleOut = view.read(keylet::line(cur, next, currency));
auto sleIn = view.read(keylet::rippleState(prev, cur, currency));
auto sleOut = view.read(keylet::rippleState(cur, next, currency));

if (!sleIn || !sleOut)
return terNO_LINE;
Expand Down
4 changes: 2 additions & 2 deletions src/libxrpl/ledger/Ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Ledger::Ledger(
}

{
auto sle = std::make_shared<SLE>(keylet::fees());
auto sle = std::make_shared<SLE>(keylet::feeSettings());
// Whether featureXRPFees is supported will depend on startup options.
if (std::ranges::find(amendments, featureXRPFees) != amendments.end())
{
Expand Down Expand Up @@ -580,7 +580,7 @@ Ledger::setup()

try
{
if (auto const sle = read(keylet::fees()))
if (auto const sle = read(keylet::feeSettings()))
{
bool oldFees = false;
bool newFees = false;
Expand Down
2 changes: 1 addition & 1 deletion src/libxrpl/ledger/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ isVaultPseudoAccountFrozen(
if (depth >= maxAssetCheckDepth)
return true; // LCOV_EXCL_LINE

auto const mptIssuance = view.read(keylet::mptIssuance(mptShare.getMptID()));
auto const mptIssuance = view.read(keylet::mptokenIssuance(mptShare.getMptID()));
if (mptIssuance == nullptr)
return false; // zero MPToken won't block deletion of MPTokenIssuance

Expand Down
4 changes: 2 additions & 2 deletions src/libxrpl/ledger/helpers/AMMHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ ammLPHolds(
auto const currency = ammLPTCurrency(asset1, asset2);
STAmount amount;

auto const sle = view.read(keylet::line(lpAccount, ammAccount, currency));
auto const sle = view.read(keylet::rippleState(lpAccount, ammAccount, currency));
if (!sle)
{
amount.clear(Issue{currency, ammAccount});
Expand Down Expand Up @@ -611,7 +611,7 @@ ammAccountHolds(ReadView const& view, AccountID const& ammAccountID, Asset const
}
else if (
auto const sle =
view.read(keylet::line(ammAccountID, issue.account, issue.currency));
view.read(keylet::rippleState(ammAccountID, issue.account, issue.currency));
sle && !isFrozen(view, ammAccountID, issue.currency, issue.account))
{
STAmount amount = (*sle)[sfBalance];
Expand Down
Loading
Loading