mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-30 02:20:39 +00:00
chore: address review nits (safeCast, whitespace, comments)
This commit is contained in:
@@ -310,8 +310,8 @@ constexpr std::size_t kPermissionMaxSize = 10;
|
||||
|
||||
/** The maximum number of transactions that can be in a batch. */
|
||||
constexpr std::size_t kMaxBatchTxCount = 8;
|
||||
|
||||
/** The maximum number of batch signers. */
|
||||
|
||||
/** The maximum number of batch signers. */
|
||||
constexpr std::size_t kMaxBatchSigners = kMaxBatchTxCount * 3;
|
||||
|
||||
/** Length of a secp256k1 scalar in bytes. */
|
||||
|
||||
@@ -24,6 +24,10 @@ public:
|
||||
ApplyFlags flags,
|
||||
beast::Journal journal = beast::Journal{beast::Journal::getNullSink()});
|
||||
|
||||
// Convenience constructor used only by tests that build an ApplyContext
|
||||
// directly (e.g. invariant checks). Production always uses the parentBatchId
|
||||
// constructor above; this one fixes parentBatchId to std::nullopt and so is
|
||||
// never valid for a batch inner (hence the TapBatch assert).
|
||||
explicit ApplyContext(
|
||||
ServiceRegistry& registry,
|
||||
OpenView& base,
|
||||
|
||||
@@ -755,7 +755,7 @@ isBatchRawTransactionOkay(STObject const& st, std::string& reason)
|
||||
// sfRawTransactions only appears on a Batch. passesLocalChecks runs on
|
||||
// unverified user and peer input, so reject (rather than assert) a non-batch
|
||||
// transaction that carries it.
|
||||
if (safeCast<TxType>(st.getFieldU16(sfTransactionType)) != ttBATCH)
|
||||
if (st.getFieldU16(sfTransactionType) != ttBATCH)
|
||||
{
|
||||
reason = "Only Batch transactions may contain raw transactions.";
|
||||
return false;
|
||||
|
||||
@@ -484,9 +484,8 @@ Batch::preflightSigValidated(PreflightContext const& ctx)
|
||||
}
|
||||
}
|
||||
|
||||
// Every required signer must be matched. This is cheaper than the signature
|
||||
// check below, so verify it first. Also covers sfBatchSigners being absent
|
||||
// while inner txns require signers (numReqSignersMatched stays 0).
|
||||
// Every required signer must be matched. Also covers sfBatchSigners being
|
||||
// absent while inner txns require signers (numReqSignersMatched stays 0).
|
||||
if (numReqSignersMatched != requiredSigners.size())
|
||||
{
|
||||
JLOG(ctx.j.debug()) << "BatchTrace[" << parentBatchId << "]: "
|
||||
|
||||
Reference in New Issue
Block a user