respond to comments

This commit is contained in:
Mayukha Vadari
2026-07-28 17:49:14 -04:00
parent 76dfc0bee6
commit 8638a1a963
3 changed files with 12 additions and 6 deletions

View File

@@ -53,7 +53,10 @@ public:
operator=(SeqProxy const& other) = default;
/**
* Factory function to return a sequence-based SeqProxy
* Factory function to return a sequence-based SeqProxy.
* Outside of tests, this function should only be used for "secondary" transaction sequences,
* e.g. `sfOfferSequence`, or sequence fields in an existing ledger object. DO NOT use this for
* the "primary" sequence of a transaction, `sfSequence`.
*/
static constexpr SeqProxy
sequence(std::uint32_t v)
@@ -62,7 +65,10 @@ public:
}
/**
* Factory function to return a ticket-based SeqProxy
* Factory function to return a ticket-based SeqProxy.
* Outside of tests, this function should only be used for "secondary" transaction sequences,
* e.g. `sfOfferSequence`, or sequence fields in an existing ledger object. DO NOT use this for
* the "primary" ticket sequence of a transaction, `sfTicketSequence`.
*/
static constexpr SeqProxy
ticket(std::uint32_t v)

View File

@@ -202,7 +202,7 @@ STTx::getSeqProxy() const
if (seq != 0)
return SeqProxy::sequence(seq);
std::optional<std::uint32_t> const ticketSeq{operator[](~sfTicketSequence)};
std::optional<std::uint32_t> const ticketSeq{at(~sfTicketSequence)};
if (!ticketSeq)
{
// No TicketSequence specified. Return the Sequence, whatever it is.

View File

@@ -201,14 +201,14 @@ CheckCreate::doApply()
return ret;
// Note that we use the value from the sequence or ticket as the
// Check sequence. For more explanation see comments in SeqProxy.h.
std::uint32_t const seq = ctx_.tx.getSeqValue();
Keylet const checkKeylet = keylet::check(accountID_, ctx_.tx.getSeqProxy());
auto const seq = ctx_.tx.getSeqProxy();
Keylet const checkKeylet = keylet::check(accountID_, seq);
auto sleCheck = std::make_shared<SLE>(checkKeylet);
sleCheck->setAccountID(sfAccount, accountID_);
AccountID const dstAccountId = ctx_.tx[sfDestination];
sleCheck->setAccountID(sfDestination, dstAccountId);
sleCheck->setFieldU32(sfSequence, seq);
sleCheck->setFieldU32(sfSequence, seq.value());
sleCheck->setFieldAmount(sfSendMax, ctx_.tx[sfSendMax]);
if (auto const srcTag = ctx_.tx[~sfSourceTag])
sleCheck->setFieldU32(sfSourceTag, *srcTag);