From 6ffe349efc6168a184a9e8dbb1aa9e7d9b22dbec Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Thu, 7 Nov 2024 02:09:38 +0100 Subject: [PATCH] [fold] clang-format --- src/libxrpl/protocol/InnerObjectFormats.cpp | 1 - src/test/app/Batch_test.cpp | 3 ++- src/test/jtx/batch.h | 4 +--- src/test/jtx/impl/batch.cpp | 5 +++-- src/xrpld/app/misc/NetworkOPs.cpp | 6 ++---- src/xrpld/app/tx/detail/ApplyContext.cpp | 3 ++- src/xrpld/app/tx/detail/Transactor.cpp | 5 +---- src/xrpld/ledger/detail/ApplyStateTable.cpp | 3 ++- 8 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/libxrpl/protocol/InnerObjectFormats.cpp b/src/libxrpl/protocol/InnerObjectFormats.cpp index b925ee2a79e..33dc822eb44 100644 --- a/src/libxrpl/protocol/InnerObjectFormats.cpp +++ b/src/libxrpl/protocol/InnerObjectFormats.cpp @@ -167,7 +167,6 @@ InnerObjectFormats::InnerObjectFormats() {sfSigningPubKey, soeOPTIONAL}, {sfTxnSignature, soeOPTIONAL}, {sfSigners, soeOPTIONAL}}); - } InnerObjectFormats const& diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index 9814097563e..e3354314f10 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -1641,7 +1641,8 @@ class Batch_test : public beast::unit_test::suite // TODO: test with `tfPartialPayment` // TODO: add a test case to exercise the behavior where the last signer // signature is correct, but previous ones are bad. - // TODO: tfUntilFailure verify it's possible that none of the inner txns succeeds and yet the batch txn is "successful"? + // TODO: tfUntilFailure verify it's possible that none of the inner txns + // succeeds and yet the batch txn is "successful"? } public: diff --git a/src/test/jtx/batch.h b/src/test/jtx/batch.h index d0d4b21a80a..797b5bfcf6b 100644 --- a/src/test/jtx/batch.h +++ b/src/test/jtx/batch.h @@ -56,9 +56,7 @@ class add add(Json::Value const& txn, std::uint32_t const& sequence, std::optional const& ticket = std::nullopt) - : txn_(txn) - , seq_(sequence) - , ticket_(ticket) + : txn_(txn), seq_(sequence), ticket_(ticket) { } diff --git a/src/test/jtx/impl/batch.cpp b/src/test/jtx/impl/batch.cpp index 5efb4341df6..4d39b6fa096 100644 --- a/src/test/jtx/impl/batch.cpp +++ b/src/test/jtx/impl/batch.cpp @@ -74,8 +74,9 @@ add::operator()(Env& env, JTx& jt) const // Optionally set ticket sequence if (ticket_.has_value()) { - batchTransaction[jss::RawTransaction][jss::Sequence] = 0; - batchTransaction[jss::RawTransaction][sfTicketSequence.jsonName] = *ticket_; + batchTransaction[jss::RawTransaction][jss::Sequence] = 0; + batchTransaction[jss::RawTransaction][sfTicketSequence.jsonName] = + *ticket_; } // Set the hash of the transaction diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index baabc6745a3..7bec276d56c 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -1140,8 +1140,7 @@ NetworkOPsImp::submitTransaction(std::shared_ptr const& iTrans) // Enforce Network bar for batch txn if (auto const view = m_ledgerMaster.getCurrentLedger(); - view->rules().enabled(featureBatch) && - iTrans->isFlag(tfInnerBatchTxn)) + view->rules().enabled(featureBatch) && iTrans->isFlag(tfInnerBatchTxn)) { JLOG(m_journal.error()) << "Submitted transaction invalid: BatchTxn present."; @@ -1221,8 +1220,7 @@ NetworkOPsImp::processTransaction( // under no circumstances will we ever accept an inner txn within a batch // txn from the network. auto const tx = *transaction->getSTransaction(); - if (view->rules().enabled(featureBatch) && - tx.isFlag(tfInnerBatchTxn)) + if (view->rules().enabled(featureBatch) && tx.isFlag(tfInnerBatchTxn)) { transaction->setStatus(INVALID); transaction->setResult(temINVALID_BATCH); diff --git a/src/xrpld/app/tx/detail/ApplyContext.cpp b/src/xrpld/app/tx/detail/ApplyContext.cpp index e2d20368a99..7c3d5969f27 100644 --- a/src/xrpld/app/tx/detail/ApplyContext.cpp +++ b/src/xrpld/app/tx/detail/ApplyContext.cpp @@ -115,7 +115,8 @@ ApplyContext::setBatchPrevAcctRootFields(ApplyViewImpl& avi) for (auto const& obj : *sleBaseAcct) { if (obj.getFName().shouldMeta(SField::sMD_ChangeOrig) && - (!sleAcct->hasMatchingEntry(obj) || obj.getFName() == sfSequence || + (!sleAcct->hasMatchingEntry(obj) || + obj.getFName() == sfSequence || obj.getFName() == sfOwnerCount || obj.getFName() == sfTicketCount)) { diff --git a/src/xrpld/app/tx/detail/Transactor.cpp b/src/xrpld/app/tx/detail/Transactor.cpp index 2882ea47c30..94aa37f5a05 100644 --- a/src/xrpld/app/tx/detail/Transactor.cpp +++ b/src/xrpld/app/tx/detail/Transactor.cpp @@ -135,10 +135,7 @@ NotTEC preflight2(PreflightContext const& ctx) { auto const sigValid = checkValidity( - ctx.app.getHashRouter(), - ctx.tx, - ctx.rules, - ctx.app.config()); + ctx.app.getHashRouter(), ctx.tx, ctx.rules, ctx.app.config()); if (sigValid.first == Validity::SigBad) { JLOG(ctx.j.debug()) << "preflight2: bad signature. " << sigValid.second; diff --git a/src/xrpld/ledger/detail/ApplyStateTable.cpp b/src/xrpld/ledger/detail/ApplyStateTable.cpp index 809f20ded75..2766ea1d282 100644 --- a/src/xrpld/ledger/detail/ApplyStateTable.cpp +++ b/src/xrpld/ledger/detail/ApplyStateTable.cpp @@ -216,7 +216,8 @@ ApplyStateTable::apply( prevs.emplace_back(obj); } - if (isBatch && nodeType == ltACCOUNT_ROOT && batchPrevAcctRootFields) + if (isBatch && nodeType == ltACCOUNT_ROOT && + batchPrevAcctRootFields) { // TODO: This could fail if the fields already exist for (auto const& obj : *batchPrevAcctRootFields)