From c61475f94c1c35191f73293715aa364ade0c198d Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Tue, 31 Oct 2023 13:29:47 +0100 Subject: [PATCH] address review updates --- src/ripple/app/misc/NetworkOPs.cpp | 8 ++++---- src/ripple/app/misc/impl/Transaction.cpp | 2 +- src/ripple/rpc/CTID.h | 4 ++-- src/test/rpc/Transaction_test.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index f73df04a95a..9e9d775cf6c 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -3112,13 +3112,13 @@ NetworkOPsImp::transJson( } // add CTID where the needed data for it exists - if (auto const& lookup = ledger->txRead(transaction.getTransactionID()); + if (auto const& lookup = ledger->txRead(transaction->getTransactionID()); lookup.second && lookup.second->isFieldPresent(sfTransactionIndex)) { - uint32_t txnSeq = lookup.second->getFieldU32(sfTransactionIndex); + uint32_t const txnSeq = lookup.second->getFieldU32(sfTransactionIndex); uint32_t netID = app_.config().NETWORK_ID; - if (transaction.isFieldPresent(sfNetworkID)) - netID = transaction.getFieldU32(sfNetworkID); + if (transaction->isFieldPresent(sfNetworkID)) + netID = transaction->getFieldU32(sfNetworkID); if (std::optional ctid = RPC::encodeCTID(ledger->info().seq, txnSeq, netID); diff --git a/src/ripple/app/misc/impl/Transaction.cpp b/src/ripple/app/misc/impl/Transaction.cpp index 82aca01c888..5cfa3ded1e3 100644 --- a/src/ripple/app/misc/impl/Transaction.cpp +++ b/src/ripple/app/misc/impl/Transaction.cpp @@ -198,7 +198,7 @@ Transaction::getJson(JsonOptions options, bool binary) const if (mTxnSeq && netID) { - std::optional ctid = + std::optional const ctid = RPC::encodeCTID(mInLedger, *mTxnSeq, *netID); if (ctid) ret[jss::ctid] = *ctid; diff --git a/src/ripple/rpc/CTID.h b/src/ripple/rpc/CTID.h index 3bfa6165076..694cfcfc123 100644 --- a/src/ripple/rpc/CTID.h +++ b/src/ripple/rpc/CTID.h @@ -30,13 +30,13 @@ namespace ripple { namespace RPC { -// CTID stands for Compact Transaction ID. +// CTID stands for Concise Transaction ID. // // The CTID comes from XLS-15d: Concise Transaction Identifier #34 // // https://github.com/XRPLF/XRPL-Standards/discussions/34 // -// The Compact Transaction ID provides a way to identify a transaction +// The Concise Transaction ID provides a way to identify a transaction // that includes which network the transaction was submitted to. inline std::optional diff --git a/src/test/rpc/Transaction_test.cpp b/src/test/rpc/Transaction_test.cpp index 39020c2ee5e..5c88b1c99e2 100644 --- a/src/test/rpc/Transaction_test.cpp +++ b/src/test/rpc/Transaction_test.cpp @@ -636,7 +636,7 @@ class Transaction_test : public beast::unit_test::suite using namespace test::jtx; - // Use a Compact Transaction Identifier to request a transaction. + // Use a Concise Transaction Identifier to request a transaction. for (uint32_t netID : {11111, 65535, 65536}) { Env env{*this, makeNetworkConfig(netID)}; @@ -653,7 +653,7 @@ class Transaction_test : public beast::unit_test::suite auto const ctid = RPC::encodeCTID(startLegSeq, 0, netID); if (netID > 0xFFFF) { - // Compact transaction IDs do not support a network ID > 0xFFFF. + // Concise transaction IDs do not support a network ID > 0xFFFF. BEAST_EXPECT(ctid == std::nullopt); continue; }