Skip to content

Commit

Permalink
address review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Oct 31, 2023
1 parent d3d98d2 commit c61475f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/ripple/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> ctid =
RPC::encodeCTID(ledger->info().seq, txnSeq, netID);
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/app/misc/impl/Transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Transaction::getJson(JsonOptions options, bool binary) const

if (mTxnSeq && netID)
{
std::optional<std::string> ctid =
std::optional<std::string> const ctid =
RPC::encodeCTID(mInLedger, *mTxnSeq, *netID);
if (ctid)
ret[jss::ctid] = *ctid;
Expand Down
4 changes: 2 additions & 2 deletions src/ripple/rpc/CTID.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>
Expand Down
4 changes: 2 additions & 2 deletions src/test/rpc/Transaction_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand All @@ -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;
}
Expand Down

0 comments on commit c61475f

Please sign in to comment.