fix(amendment): Add missing fields for keylets to ledger objects (#5646)

This change adds a fix amendment (`fixIncludeKeyletFields`) that adds:
* `sfSequence` to `Escrow` and `PayChannel`
* `sfOwner` to `SignerList`
* `sfOracleDocumentID` to `Oracle`

This ensures that all ledger entries hold all the information needed to determine their keylet.
This commit is contained in:
Mayukha Vadari
2025-09-17 17:34:47 -04:00
committed by GitHub
parent 37b951859c
commit 510314d344
12 changed files with 144 additions and 51 deletions

View File

@@ -398,7 +398,7 @@ private:
}
void
testCreate()
testCreate(FeatureBitset features)
{
testcase("Create");
using namespace jtx;
@@ -413,18 +413,30 @@ private:
env, {.owner = owner, .series = series, .fee = baseFee});
BEAST_EXPECT(oracle.exists());
BEAST_EXPECT(ownerCount(env, owner) == (count + adj));
auto const entry = oracle.ledgerEntry();
BEAST_EXPECT(entry[jss::node][jss::Owner] == owner.human());
if (features[fixIncludeKeyletFields])
{
BEAST_EXPECT(
entry[jss::node][jss::OracleDocumentID] ==
oracle.documentID());
}
else
{
BEAST_EXPECT(!entry[jss::node].isMember(jss::OracleDocumentID));
}
BEAST_EXPECT(oracle.expectLastUpdateTime(946694810));
};
{
// owner count is adjusted by 1
Env env(*this);
Env env(*this, features);
test(env, {{"XRP", "USD", 740, 1}}, 1);
}
{
// owner count is adjusted by 2
Env env(*this);
Env env(*this, features);
test(
env,
{{"XRP", "USD", 740, 1},
@@ -438,7 +450,7 @@ private:
{
// Different owner creates a new object
Env env(*this);
Env env(*this, features);
auto const baseFee =
static_cast<int>(env.current()->fees().base.drops());
Account const some("some");
@@ -864,7 +876,8 @@ public:
auto const all = testable_amendments();
testInvalidSet();
testInvalidDelete();
testCreate();
testCreate(all);
testCreate(all - fixIncludeKeyletFields);
testDelete();
testUpdate();
testAmendment();