mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-30 02:20:39 +00:00
fix autogen
This commit is contained in:
@@ -143,9 +143,9 @@ public:
|
||||
*/
|
||||
[[nodiscard]]
|
||||
protocol_autogen::Optional<SF_UINT32::type::value_type>
|
||||
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<typename SF_UINT32::type::value_type> const& value)
|
||||
setRemainingOwnerCount(std::decay_t<typename SF_UINT32::type::value_type> const& value)
|
||||
{
|
||||
object_[sfRemainingOwnerCount] = value;
|
||||
return *this;
|
||||
|
||||
@@ -157,9 +157,9 @@ public:
|
||||
*/
|
||||
[[nodiscard]]
|
||||
protocol_autogen::Optional<SF_UINT32::type::value_type>
|
||||
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<typename SF_UINT32::type::value_type> const& value)
|
||||
setRemainingOwnerCount(std::decay_t<typename SF_UINT32::type::value_type> const& value)
|
||||
{
|
||||
object_[sfRemainingOwnerCount] = value;
|
||||
return *this;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user