Skip to content

Commit

Permalink
simplify the extraction of transactionID from Transaction object
Browse files Browse the repository at this point in the history
  • Loading branch information
ckeshava authored and Bronek committed Nov 2, 2023
1 parent 94c16d8 commit 7770bc5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/ripple/rpc/handlers/AccountTx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ populateJsonResponse(
JsonOptions::include_date |
JsonOptions::disable_API_prior_V2,
false);
jvObj[jss::hash] = to_string(
txn->getSTransaction()->getTransactionID());
jvObj[jss::hash] = to_string(txn->getID());
jvObj[jss::ledger_index] = txn->getLedger();
jvObj[jss::ledger_hash] =
to_string(context.ledgerMaster.getHashBySeq(
Expand Down
3 changes: 1 addition & 2 deletions src/ripple/rpc/handlers/Tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ populateJsonResponse(
if (result.ledgerHash)
response[jss::ledger_hash] = to_string(*result.ledgerHash);

response[jss::hash] =
to_string(result.txn->getSTransaction()->getTransactionID());
response[jss::hash] = to_string(result.txn->getID());
if (result.validated)
{
response[jss::ledger_index] = result.txn->getLedger();
Expand Down
3 changes: 1 addition & 2 deletions src/ripple/rpc/impl/TransactionSign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,7 @@ transactionFormatResultImpl(Transaction::pointer tpTrans, unsigned apiVersion)
{
jvResult[jss::tx_json] =
tpTrans->getJson(JsonOptions::disable_API_prior_V2);
jvResult[jss::hash] =
to_string(tpTrans->getSTransaction()->getTransactionID());
jvResult[jss::hash] = to_string(tpTrans->getID());
}
else
jvResult[jss::tx_json] = tpTrans->getJson(JsonOptions::none);
Expand Down

0 comments on commit 7770bc5

Please sign in to comment.