Skip to content

Commit

Permalink
[fold] clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Nov 7, 2024
1 parent 1978fd3 commit 6ffe349
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/libxrpl/protocol/InnerObjectFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ InnerObjectFormats::InnerObjectFormats()
{sfSigningPubKey, soeOPTIONAL},
{sfTxnSignature, soeOPTIONAL},
{sfSigners, soeOPTIONAL}});

}

InnerObjectFormats const&
Expand Down
3 changes: 2 additions & 1 deletion src/test/app/Batch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions src/test/jtx/batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ class add
add(Json::Value const& txn,
std::uint32_t const& sequence,
std::optional<std::uint32_t> const& ticket = std::nullopt)
: txn_(txn)
, seq_(sequence)
, ticket_(ticket)
: txn_(txn), seq_(sequence), ticket_(ticket)
{
}

Expand Down
5 changes: 3 additions & 2 deletions src/test/jtx/impl/batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/xrpld/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,7 @@ NetworkOPsImp::submitTransaction(std::shared_ptr<STTx const> 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.";
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/xrpld/app/tx/detail/ApplyContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
5 changes: 1 addition & 4 deletions src/xrpld/app/tx/detail/Transactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/xrpld/ledger/detail/ApplyStateTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6ffe349

Please sign in to comment.