Skip to content

Commit

Permalink
api
Browse files Browse the repository at this point in the history
  • Loading branch information
vusirikala committed Dec 11, 2024
1 parent fe2ce00 commit e702027
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion api/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ impl Context {
limit: u16,
ledger_version: u64,
ledger_info: &LedgerInfo,
) -> Result<Vec<IndexedTransactionSummary>, E> {
) -> Result<Vec<TransactionSummary>, E> {
let txns_res = if !db_sharding_enabled(&self.node_config) {
self.db.get_account_all_transaction_summaries(
address,
Expand Down Expand Up @@ -965,6 +965,15 @@ impl Context {
.map_err(|err| {
E::internal_with_code(err, AptosErrorCode::InternalError, ledger_info)
})
.map(|txns| txns.iter().map(|t| TransactionSummary {
sender: t.sender.into(),
version: t.version.into(),
transaction_hash: t.transaction_hash.into(),
replay_protector: match t.replay_protector {
aptos_types::transaction::ReplayProtector::Nonce(nonce) => ReplayProtector::Nonce(nonce.into()),
aptos_types::transaction::ReplayProtector::SequenceNumber(seq_num) => ReplayProtector::SequenceNumber(seq_num.into())
},
}).collect())
}

pub fn get_transaction_by_hash(
Expand Down
5 changes: 3 additions & 2 deletions api/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,9 @@ impl TransactionsApi {
}
match accept_type {
AcceptType::Json => BasicResponse::try_from_json((
self.context
.render_transaction_summaries(&latest_ledger_info, data)?,
data,
// self.context
// .render_transaction_summaries(&latest_ledger_info, data)?,
&latest_ledger_info,
BasicResponseStatus::Ok,
)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl SubmissionWorker {
}).collect();
match query_txn_summaries(self.client(), start_version_by_address.clone()).await {
Ok((account_to_txn_summaries, ledger_timestamp)) => {

// Remove committed transactions from self.account_data
for (account, txn_summaries) in account_to_txn_summaries {
for txn_summary in txn_summaries {
Expand Down

0 comments on commit e702027

Please sign in to comment.