Make a few tweaks to the changes in merge cc83ea8

- Not necessarily wrong, just not how I want it.
- Fixes a build error in LoanBroker_test
- In CreateOffer, fixes a logic error where _no_ offers will work if
  PermissionedDex amendment is enabled, and FlowCross is not
This commit is contained in:
Ed Hennis
2025-07-11 16:14:10 -04:00
parent 2b5a8ebf2f
commit ad5d28bc48
4 changed files with 15 additions and 13 deletions

View File

@@ -495,6 +495,8 @@ multiSignHelper(
auto const accountID = signer.getAccountID(sfAccount);
// The account owner may not usually multisign for themselves.
// If they can, txnAccountID will be unseated, which is not equal to any
// value.
if (txnAccountID == accountID)
return Unexpected("Invalid multisigner.");
@@ -556,7 +558,7 @@ STTx::checkBatchMultiSign(
batchSigner,
std::nullopt,
fullyCanonical,
[&dataStart](AccountID const& accountID) mutable -> Serializer {
[&dataStart](AccountID const& accountID) -> Serializer {
Serializer s = dataStart;
finishMultiSigningData(accountID, s);
return s;
@@ -588,7 +590,7 @@ STTx::checkMultiSign(
sigObject,
txnAccountID,
fullyCanonical,
[&dataStart](AccountID const& accountID) mutable -> Serializer {
[&dataStart](AccountID const& accountID) -> Serializer {
Serializer s = dataStart;
finishMultiSigningData(accountID, s);
return s;
@@ -620,11 +622,12 @@ STTx::getBatchTransactionIDs() const
XRPL_ASSERT(
getFieldArray(sfRawTransactions).size() != 0,
"STTx::getBatchTransactionIDs : empty raw transactions");
if (batch_txn_ids_.size() != 0)
return batch_txn_ids_;
for (STObject const& rb : getFieldArray(sfRawTransactions))
batch_txn_ids_.push_back(rb.getHash(HashPrefix::transactionID));
// Don't early return so that the size check is always done.
if (batch_txn_ids_.size() == 0)
{
for (STObject const& rb : getFieldArray(sfRawTransactions))
batch_txn_ids_.push_back(rb.getHash(HashPrefix::transactionID));
}
XRPL_ASSERT(
batch_txn_ids_.size() == getFieldArray(sfRawTransactions).size(),

View File

@@ -197,6 +197,8 @@ class LoanBroker_test : public beast::unit_test::suite
auto verifyCoverAmount =
[&env, &vault, &broker, &pseudoAccount, this](auto n) {
using namespace jtx;
auto const amount = vault.asset(n);
BEAST_EXPECT(
broker->at(sfCoverAvailable) == amount.number());

View File

@@ -615,7 +615,7 @@ create(
} // namespace check
static constexpr FeeLevel64 baseFeeLevel{256};
static constexpr FeeLevel64 baseFeeLevel{TxQ::baseLevel};
static constexpr FeeLevel64 minEscalationFeeLevel = baseFeeLevel * 500;
template <class Suite>

View File

@@ -48,12 +48,9 @@ CreateOffer::isEnabled(PreflightContext const& ctx)
{
// Permissioned offers should use the PE (which must be enabled by
// featureFlowCross amendment)
if (ctx.rules.enabled(featurePermissionedDEX) &&
!ctx.rules.enabled(featureFlowCross))
return false;
return (!ctx.tx.isFieldPresent(sfDomainID)) ||
ctx.rules.enabled(featurePermissionedDEX);
(ctx.rules.enabled(featurePermissionedDEX) &&
ctx.rules.enabled(featureFlowCross));
}
std::uint32_t