From a7e65ea0fa51de256b8a070a7f6e15488e630cec Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 18 Jun 2026 20:22:08 -0400 Subject: [PATCH] fix autogen --- .../ledger_entries/Sponsorship.h | 8 +++---- .../transactions/SponsorshipSet.h | 8 +++---- .../ledger_entries/SponsorshipTests.cpp | 24 +++++++++---------- .../transactions/SponsorshipSetTests.cpp | 22 ++++++++--------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/xrpl/protocol_autogen/ledger_entries/Sponsorship.h b/include/xrpl/protocol_autogen/ledger_entries/Sponsorship.h index 69f09eb2d9..c309a38aef 100644 --- a/include/xrpl/protocol_autogen/ledger_entries/Sponsorship.h +++ b/include/xrpl/protocol_autogen/ledger_entries/Sponsorship.h @@ -143,9 +143,9 @@ public: */ [[nodiscard]] protocol_autogen::Optional - getReserveCount() const + getRemainingOwnerCount() const { - if (hasReserveCount()) + if (hasRemainingOwnerCount()) return this->sle_->at(sfRemainingOwnerCount); return std::nullopt; } @@ -156,7 +156,7 @@ public: */ [[nodiscard]] bool - hasReserveCount() const + hasRemainingOwnerCount() const { return this->sle_->isFieldPresent(sfRemainingOwnerCount); } @@ -301,7 +301,7 @@ public: * @return Reference to this builder for method chaining. */ SponsorshipBuilder& - setReserveCount(std::decay_t const& value) + setRemainingOwnerCount(std::decay_t const& value) { object_[sfRemainingOwnerCount] = value; return *this; diff --git a/include/xrpl/protocol_autogen/transactions/SponsorshipSet.h b/include/xrpl/protocol_autogen/transactions/SponsorshipSet.h index b1e0220cac..f0ef449de7 100644 --- a/include/xrpl/protocol_autogen/transactions/SponsorshipSet.h +++ b/include/xrpl/protocol_autogen/transactions/SponsorshipSet.h @@ -157,9 +157,9 @@ public: */ [[nodiscard]] protocol_autogen::Optional - getReserveCount() const + getRemainingOwnerCount() const { - if (hasReserveCount()) + if (hasRemainingOwnerCount()) { return this->tx_->at(sfRemainingOwnerCount); } @@ -172,7 +172,7 @@ public: */ [[nodiscard]] bool - hasReserveCount() const + hasRemainingOwnerCount() const { return this->tx_->isFieldPresent(sfRemainingOwnerCount); } @@ -267,7 +267,7 @@ public: * @return Reference to this builder for method chaining. */ SponsorshipSetBuilder& - setReserveCount(std::decay_t const& value) + setRemainingOwnerCount(std::decay_t const& value) { object_[sfRemainingOwnerCount] = value; return *this; diff --git a/src/tests/libxrpl/protocol_autogen/ledger_entries/SponsorshipTests.cpp b/src/tests/libxrpl/protocol_autogen/ledger_entries/SponsorshipTests.cpp index e528ae8ad9..e1d9ff15b9 100644 --- a/src/tests/libxrpl/protocol_autogen/ledger_entries/SponsorshipTests.cpp +++ b/src/tests/libxrpl/protocol_autogen/ledger_entries/SponsorshipTests.cpp @@ -26,7 +26,7 @@ TEST(SponsorshipTests, BuilderSettersRoundTrip) auto const sponseeValue = canonical_ACCOUNT(); auto const feeAmountValue = canonical_AMOUNT(); auto const maxFeeValue = canonical_AMOUNT(); - auto const reserveCountValue = canonical_UINT32(); + auto const remainingOwnerCountValue = canonical_UINT32(); auto const ownerNodeValue = canonical_UINT64(); auto const sponseeNodeValue = canonical_UINT64(); @@ -41,7 +41,7 @@ TEST(SponsorshipTests, BuilderSettersRoundTrip) builder.setFeeAmount(feeAmountValue); builder.setMaxFee(maxFeeValue); - builder.setReserveCount(reserveCountValue); + builder.setRemainingOwnerCount(remainingOwnerCountValue); builder.setLedgerIndex(index); builder.setFlags(0x1u); @@ -105,11 +105,11 @@ TEST(SponsorshipTests, BuilderSettersRoundTrip) } { - auto const& expected = reserveCountValue; - auto const actualOpt = entry.getReserveCount(); + auto const& expected = remainingOwnerCountValue; + auto const actualOpt = entry.getRemainingOwnerCount(); ASSERT_TRUE(actualOpt.has_value()); expectEqualField(expected, *actualOpt, "sfRemainingOwnerCount"); - EXPECT_TRUE(entry.hasReserveCount()); + EXPECT_TRUE(entry.hasRemainingOwnerCount()); } EXPECT_TRUE(entry.hasLedgerIndex()); @@ -131,7 +131,7 @@ TEST(SponsorshipTests, BuilderFromSleRoundTrip) auto const sponseeValue = canonical_ACCOUNT(); auto const feeAmountValue = canonical_AMOUNT(); auto const maxFeeValue = canonical_AMOUNT(); - auto const reserveCountValue = canonical_UINT32(); + auto const remainingOwnerCountValue = canonical_UINT32(); auto const ownerNodeValue = canonical_UINT64(); auto const sponseeNodeValue = canonical_UINT64(); @@ -143,7 +143,7 @@ TEST(SponsorshipTests, BuilderFromSleRoundTrip) sle->at(sfSponsee) = sponseeValue; sle->at(sfFeeAmount) = feeAmountValue; sle->at(sfMaxFee) = maxFeeValue; - sle->at(sfRemainingOwnerCount) = reserveCountValue; + sle->at(sfRemainingOwnerCount) = remainingOwnerCountValue; sle->at(sfOwnerNode) = ownerNodeValue; sle->at(sfSponseeNode) = sponseeNodeValue; @@ -243,10 +243,10 @@ TEST(SponsorshipTests, BuilderFromSleRoundTrip) } { - auto const& expected = reserveCountValue; + auto const& expected = remainingOwnerCountValue; - auto const fromSleOpt = entryFromSle.getReserveCount(); - auto const fromBuilderOpt = entryFromBuilder.getReserveCount(); + auto const fromSleOpt = entryFromSle.getRemainingOwnerCount(); + auto const fromBuilderOpt = entryFromBuilder.getRemainingOwnerCount(); ASSERT_TRUE(fromSleOpt.has_value()); ASSERT_TRUE(fromBuilderOpt.has_value()); @@ -323,7 +323,7 @@ TEST(SponsorshipTests, OptionalFieldsReturnNullopt) EXPECT_FALSE(entry.getFeeAmount().has_value()); EXPECT_FALSE(entry.hasMaxFee()); EXPECT_FALSE(entry.getMaxFee().has_value()); - EXPECT_FALSE(entry.hasReserveCount()); - EXPECT_FALSE(entry.getReserveCount().has_value()); + EXPECT_FALSE(entry.hasRemainingOwnerCount()); + EXPECT_FALSE(entry.getRemainingOwnerCount().has_value()); } } diff --git a/src/tests/libxrpl/protocol_autogen/transactions/SponsorshipSetTests.cpp b/src/tests/libxrpl/protocol_autogen/transactions/SponsorshipSetTests.cpp index bd2f86eb87..dce8cfca3f 100644 --- a/src/tests/libxrpl/protocol_autogen/transactions/SponsorshipSetTests.cpp +++ b/src/tests/libxrpl/protocol_autogen/transactions/SponsorshipSetTests.cpp @@ -33,7 +33,7 @@ TEST(TransactionsSponsorshipSetTests, BuilderSettersRoundTrip) auto const sponseeValue = canonical_ACCOUNT(); auto const feeAmountValue = canonical_AMOUNT(); auto const maxFeeValue = canonical_AMOUNT(); - auto const reserveCountValue = canonical_UINT32(); + auto const remainingOwnerCountValue = canonical_UINT32(); SponsorshipSetBuilder builder{ accountValue, @@ -46,7 +46,7 @@ TEST(TransactionsSponsorshipSetTests, BuilderSettersRoundTrip) builder.setSponsee(sponseeValue); builder.setFeeAmount(feeAmountValue); builder.setMaxFee(maxFeeValue); - builder.setReserveCount(reserveCountValue); + builder.setRemainingOwnerCount(remainingOwnerCountValue); auto tx = builder.build(publicKey, secretKey); @@ -97,11 +97,11 @@ TEST(TransactionsSponsorshipSetTests, BuilderSettersRoundTrip) } { - auto const& expected = reserveCountValue; - auto const actualOpt = tx.getReserveCount(); + auto const& expected = remainingOwnerCountValue; + auto const actualOpt = tx.getRemainingOwnerCount(); ASSERT_TRUE(actualOpt.has_value()) << "Optional field sfRemainingOwnerCount should be present"; expectEqualField(expected, *actualOpt, "sfRemainingOwnerCount"); - EXPECT_TRUE(tx.hasReserveCount()); + EXPECT_TRUE(tx.hasRemainingOwnerCount()); } } @@ -124,7 +124,7 @@ TEST(TransactionsSponsorshipSetTests, BuilderFromStTxRoundTrip) auto const sponseeValue = canonical_ACCOUNT(); auto const feeAmountValue = canonical_AMOUNT(); auto const maxFeeValue = canonical_AMOUNT(); - auto const reserveCountValue = canonical_UINT32(); + auto const remainingOwnerCountValue = canonical_UINT32(); // Build an initial transaction SponsorshipSetBuilder initialBuilder{ @@ -137,7 +137,7 @@ TEST(TransactionsSponsorshipSetTests, BuilderFromStTxRoundTrip) initialBuilder.setSponsee(sponseeValue); initialBuilder.setFeeAmount(feeAmountValue); initialBuilder.setMaxFee(maxFeeValue); - initialBuilder.setReserveCount(reserveCountValue); + initialBuilder.setRemainingOwnerCount(remainingOwnerCountValue); auto initialTx = initialBuilder.build(publicKey, secretKey); @@ -185,8 +185,8 @@ TEST(TransactionsSponsorshipSetTests, BuilderFromStTxRoundTrip) } { - auto const& expected = reserveCountValue; - auto const actualOpt = rebuiltTx.getReserveCount(); + auto const& expected = remainingOwnerCountValue; + auto const actualOpt = rebuiltTx.getRemainingOwnerCount(); ASSERT_TRUE(actualOpt.has_value()) << "Optional field sfRemainingOwnerCount should be present"; expectEqualField(expected, *actualOpt, "sfRemainingOwnerCount"); } @@ -254,8 +254,8 @@ TEST(TransactionsSponsorshipSetTests, OptionalFieldsReturnNullopt) EXPECT_FALSE(tx.getFeeAmount().has_value()); EXPECT_FALSE(tx.hasMaxFee()); EXPECT_FALSE(tx.getMaxFee().has_value()); - EXPECT_FALSE(tx.hasReserveCount()); - EXPECT_FALSE(tx.getReserveCount().has_value()); + EXPECT_FALSE(tx.hasRemainingOwnerCount()); + EXPECT_FALSE(tx.getRemainingOwnerCount().has_value()); } }