mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 07:10:53 +00:00
refactor: Use SeqProxy instead of uint32 for all sequence-based keylets (#7890)
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -200,22 +200,16 @@ STTx::getSeqProxy() const
|
||||
{
|
||||
std::uint32_t const seq{getFieldU32(sfSequence)};
|
||||
if (seq != 0)
|
||||
return SeqProxy::sequence(seq);
|
||||
return SeqProxy::rawSequence(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.
|
||||
return SeqProxy::sequence(seq);
|
||||
return SeqProxy::rawSequence(seq);
|
||||
}
|
||||
|
||||
return SeqProxy{SeqProxy::Type::Ticket, *ticketSeq};
|
||||
}
|
||||
|
||||
std::uint32_t
|
||||
STTx::getSeqValue() const
|
||||
{
|
||||
return getSeqProxy().value();
|
||||
return SeqProxy::rawTicket(*ticketSeq);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -459,7 +453,7 @@ STTx::checkBatchSingleSign(STObject const& batchSigner, std::vector<uint256> con
|
||||
{
|
||||
XRPL_ASSERT(getTxnType() == ttBATCH, "STTx::checkBatchSingleSign : batch transaction");
|
||||
Serializer msg;
|
||||
serializeBatch(msg, getAccountID(sfAccount), getSeqValue(), getFlags(), txIds);
|
||||
serializeBatch(msg, getAccountID(sfAccount), getSeqProxy().value(), getFlags(), txIds);
|
||||
finishMultiSigningData(batchSigner.getAccountID(sfAccount), msg);
|
||||
return singleSignHelper(batchSigner, msg.slice());
|
||||
}
|
||||
@@ -553,7 +547,7 @@ STTx::checkBatchMultiSign(
|
||||
// with the stuff that stays constant from signature to signature.
|
||||
auto const batchSignerAccount = batchSigner.getAccountID(sfAccount);
|
||||
Serializer dataStart;
|
||||
serializeBatch(dataStart, getAccountID(sfAccount), getSeqValue(), getFlags(), txIds);
|
||||
serializeBatch(dataStart, getAccountID(sfAccount), getSeqProxy().value(), getFlags(), txIds);
|
||||
dataStart.addBitString(batchSignerAccount);
|
||||
return multiSignHelper(
|
||||
batchSigner,
|
||||
|
||||
Reference in New Issue
Block a user